[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Apache rotatelogs vs. logrotate questions



Hi,

I am just searching the perfect solution for logfile-rotation.
The goal is to get a 24-hour rotation exactly at midnight and the
logfiles named "%y-%m-%d-access.log"

logrotate and rotatelogs seem to be candidates for the task, but
manpages leave some questions open.


A)

rotatelogs: 
There is no documentation about which time exactly the rotationtime
starts. My tests showed, that restarting apache seems to trigger the
countdown of the rotationtime. This seems to be a source for trouble
in my eyes, as it will make it impossible to guarantee a logfile
rotation e.g. exactly at 23.59, because the rotationtime is always
triggered new, if the server is restarted. So if for some maintanance
task the server is restarted at 4pm, the logrotation will always take
place at 4pm (value 86000 for rotationtime). 

Is this right? 

If yes, this tool doesn´t seem to be very useful, because manual
restarts will interfere with periodically logrotation.


B)

rotatelogs:
What exactly does offset define? I read the ucf-thing, but what does
this mean? 


C)

I really like the strftime-feature of rotatelogs. As I can not find
anything about this in the CustomLog directive, this does not seem to
be available for definitions of logfile-names in httpd.conf. is it
possible any other way to get this done with logrotate? 


D)

logrotate: Does apache NEED the "create" feature of logrotate or will
it interfere with apache?


E)

logrotate: Is an "apache reload" as "postscript" needed or is "apache
restart" recommended? This seems to be needed to release
apache-filedescriptors from the old logfile, right? Does this
interfere with the "create" feature (see D)?


F)
I read about problems with logrotate and ssl. What exactly do I have
to think about, if I want to use logrotate for mod-ssl-enabled
servers?


Thank you very much for your attention, any answers to this questions
will hopefully also help others that want to get a grip on logfile
rotation.




Have a nice thread,
Peter



Reply to: