Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Write logging utility, or does one exist

by davidrw (Prior)
on May 04, 2005 at 16:30 UTC ( [id://454038]=note: print w/replies, xml ) Need Help??


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.
  • Comment on Re: Write logging utility, or does one exist

Replies are listed 'Best First'.
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://454038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found