Open javadevmtl opened 7 years ago
Is there a standard out there? I hesitate to simply change the hard-coded constants here due to lack of backward compatibility that would create, but perhaps we can use a configuration file located on the classpath (in a similar manner to log4j.xml) to allow these names to be configured.
Note that it's really straight-forward to add configuration to each logger, but I anticipate that ensuring the configuration is properly set when every logger is instantiated would be challenging.
Thoughts?
It doesn't seem like it. Config would be the only way. I guess or maybe custom layout?
I'm going to look at adding a config file for this. I'm also contemplating adding support to override the JSON to output "plain text" via a config file setting - to support use of this library both for json-logging and non-json-logging applications.
I would like to give a +1 for allowing a mapping config for the default fields. I am using this with StackDriver logging in kubernetes and I need to map the "level" field to "severity" and a few others. Let me know if I can help get this going in a PR
Please see the following issue: https://github.com/savoirtech/slf4j-json-logger/issues/10
Hi I'm using slf4j bridged to log4j.
When using JsonLayout of Log4j the field name are not the same.
For instance Log4j uses timeMillis and it is the epoch time in milliseconds. While slf4j-json-logger uses at timestamp.
Or thread in log4j vs thread_name in slf4j-json-logger.
What's your take on this? :)