Use the WatchedFileHandler for logging to allow log rotation.

Review Request #1587 — Created May 9, 2010 and submitted

Information

Djblets
master

Reviewers

Use the WatchedFileHandler for logging to allow log rotation.

We've been using FileHandler, which writes to a file but stops logging when
the file is pulled out from underneath it (such as during log rotation).

Python 2.6 includes a new WatchedFileHandler, which checks before writing
whether the log file still exists. If it doesn't, it reopens the file for
writing. This allows it to handle log rotation fine. We now make use of this
logger for both the standard log and the profile log.

We also bundle the WatchedFileHandler as part of Djblets (with a
copyright notice) in order to support Python 2.4 and 2.5.

 
david
  1. 
      
  2. djblets/log/__init__.py (Diff revision 1)
     
     
    except ImportError, please.
    1. Oops.. Pokemon exception handling.
  3. 
      
chipx86
Review request changed
Change Summary:
Remove pokemon exception handling for the WatchedFileHandler import.
david
  1. You just wanted to use that phrase.
  2.