I\'m using SLF4J with Logback in a JAX-RS application... I want to log to JSON in such a way that my message is not encoded again but printed raw into the logfile:
At t
Just came over this myself and found an article with a few recommandations on logging.
If you use maven put this dependency into pom.xml
net.logstash.logback
logstash-logback-encoder
3.4
And put something like this into logback.xml
logs/${PROJECT_ID}.json
1
logs/${PROJECT_ID}.json.%i
1MB
This creates example.json
file under logs/
. The file is rolled once when it reaches 1MB in size.
LOGGER.debug(append("object", someObject), "log message");