HTTP logging

Vinay Sajip vinay_sajip at yahoo.co.uk
Mon Feb 20 18:47:54 CET 2012


On Feb 20, 5:07 pm, Jean-Michel Pichavant <jeanmic... at sequans.com>
wrote:

> However, I looked into the code and find out an (undocumented ?)
> attribute of the logging module : raiseException which value is set to 1
> by default (python 2.5.2 logging.__version__ < '0.5.0.2' > ).
>
> When set to 1, handlerError print the traceback.
>
> This has been probably fixed in recent version of the module since the
> handleError doc does not reference raiseException anymore.

Actually, I think it's a mistake in the docs - when they were
reorganised a few months ago, the text referring to raiseExceptions
was moved to the tutorial:

http://docs.python.org/howto/logging.html#exceptions-raised-during-logging

I will reinstate it in the reference API docs, but the answer to
Jason's problem is to either subclass HTTPHandler and override
handleError to suppress the error, or set logging.raiseExceptions to
True (in which case all logging exceptions will be swallowed - not
necessarily what he wants).

Regards,

Vinay Sajip



More information about the Python-list mailing list