http://qs321.pair.com?node_id=1003922


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.)