Comment 8 for bug 772397

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : A change has been merged to openstack/glance

Reviewed: https://review.openstack.org/348
Committed: http://github.com/openstack/glance/commit/20f09f6bd589613043e5b1eba70aa38bb63746b4
Submitter: Jenkins
Branch: milestone-proposed

 status fixcommitted
 done

commit 20f09f6bd589613043e5b1eba70aa38bb63746b4
Author: Mark McLoughlin <email address hidden>
Date: Thu Aug 25 12:20:51 2011 +0100

    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