Steve R. Hastings <stev...@users.sourceforge.net> added the comment:

The solution recommended in the logging cookbook does not do the same thing as 
I have proposed.

I have proposed a logging handler that emits JSON suitable for ingestion by a 
log collection system.  With the JSON formatter, all log events, no matter 
their source, are written completely in JSON.  This includes log events from 
already-written library functions that have no expectation of JSON output.  
Also the JSON formatter writes timestamps in the now-universally-understood 
RFC3339 format, the easiest date format to parse.

The logging cookbook solution is that the user must explicitly write JSON data 
into the message line of each call to the logging code.  This would make some 
or all of the message field into JSON but does not solve the problem of logging 
in JSON; the other fields of the log file would remain non-JSON.

A company that is using a log collection system might need the logs to be pure 
JSON.  The proposed JSON formatter solves that problem.

P.S. Here is a blog posting on why it is useful to log in pure JSON:

https://journal.paul.querna.org/articles/2011/12/26/log-for-machines-in-json/

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33510>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to