This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [PATCH] Allow custom logging Handlers in logging config files
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: pjenvey, vinay.sajip
Priority: normal Keywords: patch

Created on 2008-07-16 23:38 by pjenvey, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
logging-custom-Handler_r65033.diff pjenvey, 2008-07-16 23:38
Messages (2)
msg69858 - (view) Author: Philip Jenvey (pjenvey) * (Python committer) Date: 2008-07-16 23:38
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
msg69945 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2008-07-18 09:02
Checked into SVN.
History
Date User Action Args
2022-04-11 14:56:36adminsetgithub: 47639
2008-07-18 09:02:04vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg69945
2008-07-16 23:40:10benjamin.petersonsetassignee: vinay.sajip
2008-07-16 23:38:48pjenveycreate