dimanche 24 juillet 2016

Python logger not printing out 'extra' dictionary info

In my python code I pass a dictionary into the logger for example.

extra_info = {"test":"data"}
logger.info("",extra=extra_info)    

My hope is to get the extra info to print and I assumed it was in the message but when I use this format

format=%(asctime)s %(levelname)s %(name)s: %(message)s

The extra_info content are not being printed. I just get the following

2016/06/17 13:10:47 INFO test:

Aucun commentaire:

Enregistrer un commentaire