Package Products :: Package ZenUtils :: Module configlog |
[hide private]
[frames] | no frames]

# Module configlog

source code

Creates new loggers from a python logging configuration file.

Classes | [hide private]
ZenFileHandler Like python's FileHandler but relative to ZENHOME/log/
ZenRotatingFileHandler Like python's RotatingFileHandler but relative to ZENHOME/log/
ZenTimedRotatingFileHandler Like python's TimedFileHandler but relative to ZENHOME/log/

Functions | [hide private]
_relativeToLogPath(filename) Returns the filename relative to ZENHOME/log/ | source code
addLogsFromConfigFile(fname, configDefaults=None) Add new loggers, handlers, and fomatters from a file. | source code
_zen_install_loggers(cp, handlers) Create and install loggers, without wiping existing ones. | source code

Variables | [hide private]
| log = `logging.getLogger("zen.configlog")`

Function Details | [hide private]

### addLogsFromConfigFile(fname, configDefaults=None) | source code
Add new loggers, handlers, and fomatters from a file. Returns whether the file successfully loaded. The file should be in the standard Python log config format described here: http://docs.python.org/library/logging.config.html#configuration-file-format This code was copied from the Python 2.7 logging.config.fileConfig() method, then altered to not require root or wipe existing loggers. Unfortunately the standard option "disable_existing_loggers=False" would still wipe out their settings and replace root, undoing Zope's log config.