Re: [Patch] Log file handler: limit log size by number of lines
| From: | Jon Parise | Date: | Sat, 14 Oct 2006 19:33:37 +0000 |
| Subject: | Re: [Patch] Log file handler: limit log size by number of lines | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-44532@lists.php.net to get a copy of this message | ||
On Fri, Oct 13, 2006 at 05:30:42PM -0600, Trevor Burnham wrote:
> Attached is a patch for the Log package (only file.php is affected)
> that adds a new optional configuration parameter to the file handler:
> lineLimit. If lineLimit is a positive integer, then when the close()
> function is called, the log is rewritten with only the most recent n
> lines, where n is the value of lineLimit. (If it's desirable to
> reduce the log in this way before the file is closed, there is also a
> publicly accessible reduceLog() function.)
I appreciate your contribution. However, my opinion on adding this
kind of functionality to the Log package remains unchanged from the
last time it was suggested (under the "log rotation" heading):
http://beeblex.com/lists/index.php/php.pear.dev/35875
Essentially, I believe that log file maintenance tasks should be
handled by an external utility. Performing those tasks within the
file handler itself is error prone, unreliable, and unnecessarily
complex.
--
Jon Parise (jon of php.net) :: The PHP Project (http://www.php.net/)