-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch file based logging to WatchedFileHandler for logrotate
Fixes lp:772397 FileHandler opens the logfile at startup, keeps the stream open and continues to log to it forever. If logrotate decides to rotate the file, it will rename the original file and a new file is created with the same attributes as the original file. The problem is that the process is still writing to the original file, not the newly created file. Traditionally, system daemons respond to a SIGHUP by re-opening log files and logrotate can be configured to deliver this signal on rotation. However, python has an elegant solution. WatchedFileHandler monitors the inode for the specified log file name and, if that ever changes, it re-opens the stream. Nova already uses WatchedFileHandler to good effect. See: https://code.launchpad.net/~soren/nova/logrotate/+merge/50292 Change-Id: I7f693f133d230d65d7c94ebf3a2ec0c8b362f993
- Loading branch information
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters