Re: Rotating Log-Container

From: Date: Wed, 02 Feb 2005 21:33:22 +0000
Subject: Re: Rotating Log-Container
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-35889@lists.php.net to get a copy of this message
On 2/2/05 3:14 AM Pacific Time, Stephan Wentz (stephan@wentz.it) wrote: > I've implemented a Log-Container for Log-1.8.7 which rotates the > logfiles based on several conditions (like filesize, number of lines, > last modification-date). > ... > I need this container because on our managed server I can't use external > tools like logrotate to maintain the logfiles, which grow large very fast... Hi Stephan, I've been following this thread, and so far I haven't seen a mention of why exactly the log files need to be rotated, other than the fact that they become very large very quickly. If the goal is to have a collection of log files that are somewhat manageable in size, why can't you just dynamically specify logfile names based on windows of time? Hourly logs as "logfile_%m%d%Y_%H.log", for example. If logs-by-the-hour are still too large, come up with a little routine that segments an hour into 15 minute chunks, and determines which chunk the current minute is in, and determines the appropriate logfile name based on that. Wouldn't that solve the problem -- manageable log file sizes without any system calls, line counting or race conditions? -Clay -- Killersoft.com

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