[Zope] Newsyslog

Flynt rhess@bic.ch
Fri, 29 Jun 2001 13:50:27 +0200


Daniel Fairs wrote:
> 
> Hi,
> 
> I'm using newsyslog to turn over the Zope logfile. However, I have to
> restart Zope each time the log gets turned over. Is there any way of getting
> around this? Or should I just buy a bigger drive? ;)
> 
> Cheers,
> Dan
> 

Hi Daniel,

I am not acquainted to the newsyslog script, but often in thoses scripts
the rotation takes place by copying or moving the actual log file to
something new and recreate (or let recreate) a fresh log file, thus
forcing to restart a process writing to this log file.

Maybe one other possibility is instead to copy the log file (first step
from above, but no *move* !), and then sort of empty the old log file by
writing /dev/null into it (i.g. cat /dev/null > logfile). This way you
keep your file handle respectively inode. I didn't test it on the Zope
log file yet, but it works in other cases. Perhaps you can modify your
log-rotation-script according these lines.
(I impudently assume that you are working on some "LinUnixux" box; I
don't know of an equivalent to /dev/null on Windows; but in that case
you are most probably unable to modify anyway or you have to script some
kind of wrapper; in that case, maybe you can replace /dev/null
functionality by copying some empty file over the old log ???).

Regards,
---Flynt