How do I change the default format of log messages in python app engine?

Posted by dazed-n-confused on Stack Overflow See other posts from Stack Overflow or by dazed-n-confused
Published on 2010-03-31T23:21:20Z Indexed on 2010/03/31 23:23 UTC
Read the original article Hit count: 237

Filed under:
|
|

I would like to log the module and classname by default in log messages from my request handlers.

The usual way to do this seems to be to set a custom format string by calling logging.basicConfig, but this can only be called once and has already been called by the time my code runs.

Another method is to create a new log Handler which can be passed a new log Formatter, but this doesn't seem right as I want to use the existing log handler that App Engine has installed.

What is the right way to have extra information added to all log messages in python App Engine, but otherwise use the existing log format and sink?

© Stack Overflow or respective owner

Related posts about python

Related posts about google-app-engine