Results 1 to 2 of 2
Is there any way you guys on the forums know how to do logrotation without requiring a restart of the application that is doing the logging?...
- 08-18-2011 #1Just Joined!
- Join Date
- Jul 2011
- Posts
- 6
Log rotation without restarting the application
Is there any way you guys on the forums know how to do logrotation without requiring a restart of the application that is doing the logging?
- 08-18-2011 #2
Some options:
- The application might be able to do logrotation on its own
- the application at least has a signalhandler, which will cause it to release the handle of the logfile and open another one
- the application can log to a pipe. Apache is an example. Then tools like managelogs or cronolog can be used to deal with logs.
- Not really a good way: One could copy the logfile, and after that cat /dev/null >logfile.
The application doesnt need a restart and it will happily continue writing to the filehandle.
But the copied logfile might not contain the latest lines.You must always face the curtain with a bow.


Reply With Quote