Is it possible to let log4j output its logging in JSON format by only altering the log4j.properties.xml
configuration file?
I make use of an old application tha
I used logback.xml with below pattern
{"level":"%p","timestamp":"%d{ISO8601}","thread":"%t","file":"%F", "line":"%L","message":"%m"}%n
and it generates logs in json format. I am using log4j which comes with springboot dependencies.
{"level":"INFO","timestamp":"2020-09-22 15:26:38,354","thread":"main","file":"StartupInfoLogger.java", "line":"55","correlationId":"","message":"Starting Application on XX with PID 88794 (/Users/Documents/target/classes started by xxx in /Users/Documents)"}