logging overhaul
[email protected] (Jason R. Mastaler)
| Newsgroups | gmane.mail.spam.tmda.devel |
|---|---|
| Message-ID | <[email protected]> |
I think the next thing I'm going to look at is overhauling the logging
system. By default the current procmail-like file logging will be
maintained, with the option for more advanced handling, courtesy of
Python's logging module[1]. Out of the box, this module provides the
following "handlers":
* StreamHandler - logging to a stream, defaulting to sys.stderr.
* FileHandler - logging to disk files.
* RotatingFileHandler - logging to disk files with support for rollover, rotating files.
* SocketHandler - logging to a streaming socket.
* DatagramHandler - logging to a UDP socket.
* SMTPHandler - logging to an email address.
* SysLogHandler - logging to Unix syslog.
* MemoryHandler - buffering records in memory until a specific trigger occurs (or until the buffer gets full).
* HTTPHandler - sends events to a Web server using either GET or POST semantics.
Pretty cool. Right off the bat I can see this being useful to me, by
making LOGFILE_DEBUG go to my e-mail address so that I know
immediately when TMDA raises an exception.
Footnotes:
[1] http://docs.python.org/lib/module-logging.html
http://www.red-dove.com/python_logging.html