Re: Rotating Log-Container

From: Date: Fri, 04 Feb 2005 09:57:14 +0000
Subject: Re: Rotating Log-Container
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35934@lists.php.net to get a copy of this message
bertrand Gugger wrote:
Stephan Wentz wrote:
But is it really necessary? Having $maxFiles=4 would do this on a rotate: logfile.3 -> logfile.4 logfile.2 -> logfile.3 logfile.1 -> logfile.2 logfile -> logfile.1 If another process interferes with this it would try to move a non-existing file,
process 1: logfile.2 -> logfile.3 process 2: logfile.3 -> logfile.4 so globally we have: logfile.2 -> logfile.4
Am I missing something or would using a lockfile (or directory) help? Something like: o check rotate trigger o if need to rotate o try to acquire lock o if blocked continue as we were else rotate logs and release lock o continue with logging as usual. Seems without raceconditions to me. BTW: Rotating logfiles seem a perfectly useful and appropriate Log target to me. ------------ Ants Aasma

« previous php.pear.dev (#35934) next »