0

From what i found on the web, "the way" to make Apache2 use rolling log files is to write a cron job that stop apache, rolls the log file, and starts it again.

Is there a saner way that doesn't force an apache shutdown?

2 Answers 2

3

You didn't specify what operating system, so I'm going to assume you're on a Linux system. In CentOS, the logrotate "daemon" already has this written out for you. When it rotates the log, it uses the httpd reload command, which to my understanding does not exit the apache process, meaning no requests are rejected during that short interval. Try and look in /etc/logrotate.d/httpd for the rules. If that file doesn't exist, you can easily make one based off of any of the other rules you'll find in the logrotate.d folder.

1
  • Thanks - I'm using Ubuntu, and I found the config in /etc/logrotate.d/apache2
    – ripper234
    Nov 7, 2011 at 16:31
2

You can use Piped Logs as described here: Piped Logs

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .