I am trying to deploy a spring boot web app to Jboss EAP 7.1 server. When app runs in Tomcat (spring boot embedded tomcat server), by default it produces Json formatted logs as I have configured logback with slf4j.
But when I try to deploy the same in JBOSS, jboss is not writing any Json format logging. I checked in the web and found that logback is not supported out of the box in JBOSS EAP 7.1.
So I found an article to configure it in JBOSS. [https://blog.anotheria.net/devops/enable-logback-in-jboss/
Now I see that the default log manager is logback but output is still same as normal text?
Expected O/P:
{"timeStamp":"2020-04-27T21:38:28.411+05:30","message":"This is a warn message","logger":"com.example.demo.WelcomeController","thread":"http-nio-8080-exec-3","level":"WARN"}
{"timeStamp":"2020-04-27T21:38:28.415+05:30","message":"This is an error message","logger":"com.example.demo.WelcomeController","thread":"http-nio-8080-exec-3","level":"ERROR"}
Current O/P:
2020-04-27 21:12:17,787 INFO [stdout] (default task-1) 21:12:17.787 [default task-1] DEBUG com.example.demo.WelcomeController - This is a debug message
2020-04-27 21:12:17,788 INFO [stdout] (default task-1) 21:12:17.788 [default task-1] INFO com.example.demo.WelcomeController - This is an info message
2020-04-27 21:12:17,790 INFO [stdout] (default task-1) 21:12:17.790 [default task-1] WARN com.example.demo.WelcomeController - This is a warn message
2020-04-27 21:12:17,793 INFO [stdout] (default task-1) 21:12:17.791 [default task-1] ERROR com.example.demo.WelcomeController - This is an error message
Only changes between the article mentioned above and my configuration is the logback version -
<module xmlns="urn:jboss:module:1.5" name="ch.qos.logback">
<resources>
<resource-root path="logback-classic-1.2.3.jar"/>
<resource-root path="logback-core-1.2.3.jar"/>
</resources>
<dependencies>
<module name="org.slf4j" />
<module name="javax.api" />
<module name="javax.mail.api" />
</dependencies>
</module>
So is there any additional change I have to do? How can I achieve the desired output.
Did not get any response in Jboss tag, so adding spring-boot tag, if anyone can help.