JSON logging
See original GitHub issueIs it possible to get JSON output in the logs? For example, the following log line:
2019-01-10 12:15:07 root:DEBUG thumbor running at 0.0.0.0:8001
… would be awesome to be able to have as:
{
"timestamp": "2019-01-10 12:15:07",
"name": "root",
"level": "DEBUG",
"message": "thumbor running at 0.0.0.0:8001"
}
I guess I could just tweak the format, but I’d need to escape the message, in case the message would have qoutes in it. Ideas?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
JSON Logging: What, Why, How, & Tips - Coralogix
The simplicity and flexibility of JSON make it an ideal candidate for generating structured log statements; log data can be extracted and ...
Read more >8 Essential Tips for JSON logging - Papertrail
8 Essential Tips for JSON logging · Validate Your JSON · Create a Standard Schema · Include a Timestamp in Every Message ·...
Read more >json-logging - PyPI
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK. Go here for...
Read more >Get Log Output in JSON - Baeldung
Learn how output JSON using the two most popular logging libraries, Jog4j2 and Logback.
Read more >JSON Logging: 7 Must-Know Tips - Atatus
JSON logging is a type of structured logging in which log data is interpreted and saved in a JSON format. Tips for the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Would be good to have structured logging in thumbor, but I think the best way to go about this is to use thumbor’s own mechanisms for extensibility and allow people to implement their own loggers.
What do I mean by that?
We could change all logging in thumbor to be something like:
Then we’d implement the
StdoutLogger
that just prints these as:As well as the
JSONLogger
, that prints:What do you guys think?
@heynemann are there any updates for JSON logging planned?