log size handling

z.szalbot at lcwords.com z.szalbot at lcwords.com
Thu Jul 31 23:45:23 UTC 2008


Hello,

> The restart process with apache is that all the child processes are
> shutdown -- either straight away (for a plain restart) or once they've
> finished their current bit of work (fora graceful restart). As the child
> process shuts down, it closes all the file descriptors used for logging.

I put two entries in newsyslog.conf. One for rotating all logs at the start
of the month, and the other one specifically for the site which gets many
hits to rotate its log once it grows more than 25MB in size.

/var/log/*-access.log           644  12    *    $M1D0 GZC 
/var/run/httpd.pid   30
/var/log/example.com-access.log        644  100    25000    * ZC 
/var/run/httpd.pid       30

The log was indeed rotated when it grew larger than the specified size but
it was not rotated at the start of the month. Any idea why? Is it so that
the first entry effectively eliminates the second? If so, how can I make
sure the log does not grow too large and is rotated at the start of the
month?

Many thanks!

Zbigniew Szalbot



More information about the freebsd-questions mailing list