[issue21608] logging.handlers.HTTPHandler.setFormatter() has no effect

Vinay Sajip report at bugs.python.org
Fri May 30 00:27:55 CEST 2014


Vinay Sajip added the comment:

HTTPHandler doesn't exactly format text for output - it encodes the LogRecord fields into an HTTP GET or POST request, and sends that request to a web server. Since this "formatting" is determined by the HTTP protocol, it is not possible to share it with formatting for other destinations (like console or file).

I don't think a patch which somehow shoehorns a Formatter into mapLogRecord() will be acceptable, both for reasons of backward compatibility and also because formatting in general is not the same as encoding for HTTP, and trying to push the two things together seems kludgy. I advise you to subclass HttpHandler if its default behaviour doesn't work for you. After all, that's why we have classes in Python :-)

----------
resolution:  -> not a bug
status: open -> pending

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21608>
_______________________________________


More information about the Python-bugs-list mailing list