in reply to Write logging utility, or does one exist
Maybe not as gracefully as envisioned by the plans for your utility, but I believe that logrotate can accomplish all your required functionality.
The 'copytruncate' option should take care of the cases where there's concern about HUP/restart'ing the log generation app.
As for pattern matching, the equivalent of this could be accomplished by leveraging the 'prerotate' or 'postrotate' script options, or could probably also be done via a custom script invoked via the 'compresscmd' option.
Re^2: Write logging utility, or does one exist
by gnu@perl (Pilgrim) on May 04, 2005 at 16:47 UTC
|
Thank you for pointing out those very important features of logrotate. You are correct in your statements, but one of the problems we have seen is in the copytruncate feature. For some reason, some of the initial log files do not return to size 0 when truncated, the binary must be shut down before the space is released.
The pre/postrotate scripts could definately be modified to include/exclude data, but this would not prevent the initial accumulation of this data in the log file. Also as this would be a 'live' utility vs. a cron utility (ie. logrotate) it would be able to catch those runaway situations where the log file fills the file system before logrotate is run.
I apologize, I should have included the above information in the initial question. | [reply] |
|