You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Russell Stanfield <ru...@hotmail.com> on 2015/06/25 11:04:24 UTC

[users@httpd] advice on using rotatelogs, CusomLog etc

Hi,
I have been following this site to set up rotatelogs
http://httpd.apache.org/docs/2.2/programs/rotatelogs.html
What I have ended up adding to my Apache servers httpd.conf is this:

CustomLog "|/usr/sbin/rotatelogs -f -c /apps/squid/var_log_httpd/access_log.%Y.%m.%d.%H.%M 86400" commonCustomLog "|/usr/sbin/rotatelogs -f -c /apps/squid/var_log_httpd/error_log.%Y.%m.%d.%H.%M 86400" common
I've commented out these lines:
#ErrorLog logs/error_log#CustomLog logs/access_log combined
My aim is to have the access_log and the error_log turned over daily at midnight. However I'm not sure what I've added/commented out is actually doing that. I'm thinking that the 2 lines I have added are actually just creating 2 copies of the access_log, just with different file names. That's because wen I look at the contents of the files generated they are exactly the same.
I tried adding this:
ErrorLog "|/usr/sbin/rotatelogs -f -c /apps/squid/var_log_httpd/error_log.%Y.%m.%d.%H.%M 86400" common
But when I stopped/started Apache I got this error:
Starting httpd: Syntax error on line 559 of /etc/httpd/conf/httpd.conf:ErrorLog takes one argument, The filename of the error log                                                           [FAILED]

So my question is, does what I've added create and rotate both the access_log and the error_log?
Thanks in advance.
Russell.


 		 	   		  

Re: [users@httpd] advice on using rotatelogs, CusomLog etc

Posted by Yann Ylavic <yl...@gmail.com>.
Hi,

On Thu, Jun 25, 2015 at 11:04 AM, Russell Stanfield
<ru...@hotmail.com> wrote:
>
> I tried adding this:
>
> ErrorLog "|/usr/sbin/rotatelogs -f -c /apps/squid/var_log_httpd/error_log.%Y.%m.%d.%H.%M 86400" common
>
> But when I stopped/started Apache I got this error:
>
> Starting httpd: Syntax error on line 559 of /etc/httpd/conf/httpd.conf:
> ErrorLog takes one argument, The filename of the error log
>                                                            [FAILED]

Just remove the trailing "common" argument, it is meant for CustomLog
only, not ErrorLog.

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org