Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Log File Rotation

by Tanktalus (Canon)
on Nov 15, 2012 at 03:00 UTC ( #1003922=note: print w/ replies, xml ) Need Help??


in reply to Log File Rotation

Ideally, you get that program to do its own log rotation. Second choice is to get it to respond to a SIGHUP as mentioned earlier to close and reopen its log handles (you rename them yourself first, and then send the signal).

Right near the bottom is to create a named pipe (see POSIX::mkfifo / mkfifo) on the log file location first, receiving all of the log entries, and you write them out to the rotating log files. It's moderately evil, but so is 500MB of logging per minute. You just sit there reading from the fifo pipe, and every line you get you can then pipe into Log::Log4perl / Log::Dispatch. You just have to configure these to use Log::Dispatch::FileRotate, and your problem is basically solved. :-) (Still evil, though.)


Comment on Re: Log File Rotation

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2014-07-24 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (164 votes), past polls