I'm working on an app whose logs are formatted as JSON with a structure similar to
{"level": "INFO", "lineno": 85, "timestamp": "2020-01-01", "message": "Some message"}
This format works great in production where the logs are sent to ELK, but as the logs get more complicated it's harder understand them in PyCharm.
I'm looking for a way to format the output of the console (so I don't have to change the format of the logs in the code) to something more readable e.g.
2020-01-01 INFO 85 Some message
Looking for some solution I found this option that uses bunyan
and also a suggestion to use GrepConsole. I didn't manage to make either of them work.
The bunyan
solution simply didn't work. The logs kept showing as JSON and GrepConsole is great for filtering or highlighting some text, but not for manipulations.
Any ideas would be greatly appreciated.
DEBUG
flag to your code or your environment and format the output before sending it to console if running in debug mode? – Aldwin