views:

14

answers:

1

Hi -

I want to configure apache so that the access and error logs generated from apache include are named as follows:

<server-name>_access_<timestamp>
<server-name>_error_<timestamp>

I have the timestamp part figured out using rotatelogs:

CustomLog logs/access_log combined
CustomLog "|bin/rotatelogs -l /var/logs/access_%Y-%m-%d 86400" common

The part that I cannot figulre out is how to include the server name in the filename. I am configuring Apache on a linux box.

Regards, Mohan

A: 

Check out the mod_log_config documentation; iIt looks like you want either %v or %V:

%...v    The canonical ServerName of the server serving the request.
%...V    The server name according to the UseCanonicalName setting.
John Ledbetter