I hope to add the following log points to my application and display the full contents of extra
on console, e.g.,
logger.info('Status', extra={'foo':data})
logger.info('Status', extra={'bar':data})
logger.info('Status', extra={'foo':data, 'bar':data})
and I hope to see:
2016-10-10 15:28:31,408, INFO, Status, foo=data
2016-10-10 15:38:31,408, INFO, Status, bar=data
2016-10-10 15:48:31,408, INFO, Status, foo=data, bar=data
Is this even possible? According to official logging documentation, the Formatter
must be set up with a format string that expects foo
and bar
but in my case all I want is to dump out the entire kwargs of extra
without prior knowledge of foo
and bar
.