Add JSON format strategy
Feature request for a JSON format strategy.
- Each line is a JSON containing all log properties and values
I think for log point of view, it might not be that readable. Would you mind to show me an example though?
For readability you already have CSV and pretty logs, but for easy parsing it is a very common solution to use JSON format. In fact there are many tools for parsing JSON logs that allow to filter logs by "field", gather info, etc, like the ELK stack (elasticksearch, logstash, kibana).
I want to implement a JSON handler for myself when I have time, as I need this for a project in which the standard is to use JSON logs with some specific fields, one per line. It is the same Idea as for CSV but each line will be a JSON. I can send you the class when I have time to implement it, just in case you find it useful for the library.
A good example is this library for python structlog.
Also this one serilog.
👍 I see your point now. That'd be great to have a PR for this, we can discuss over PR and definitely can add it.
As soon as I have time I will implement it, and I will do a pull request. :+1:
I am sure that this feature will make this library more attractive to potential users.