Issue 3389: [PATCH] Allow custom logging Handlers in logging config files (original) (raw)
Python 2.5 added support for specifying a custom logging Formatter class in logging configuration files. Handler classes can also be specified, but your choice is limited to classes that live in the logging module.
A current workaround this is to manually add your custom Handler class to the logging module prior to loading the logging config file, but then you're no longer driving logging configuration purely from a config file (which is the entire point). This is particularly important for apps that are driven entirely from a config file that also includes logging information (such as Pylons applications)
The following patch will cause Handler classes to be resolved just like Formatter classes if the check for the Handler class in the logging module fails.
FYI this patch has been used in Paste (in particular for Pylons apps) for over a year so I consider it stable