Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jboss as 5.1 logback slf4j log4j

I am using logback in a webapp on jboss 5.1. The webapp is using slf4j API. The output, though, looks like a combination of log4j and logback. The log4j message appears to be the logback output. Hence, tow timestamps, INFO and DEBUG, etc.

2011-02-02 09:34:05,359 INFO [STDOUT] (http-127.0.0.1-8080-2) 09:34:05.359 [http-127.0.0.1-8080-2] DEBUG com.clear.wib.servlet.Proxy - wib data available = 1783

How can I get the webapp to only output the logback message? Thanks!

like image 923
Mogrifier Avatar asked Feb 02 '11 15:02

Mogrifier


1 Answers

I don't think you can. JBoss hijacks the SLF4J APi and redirects it into its own logging framework, and from then on to Log4j. If you try and re-redirect it to Logback, you're going to get inconsistent results.

Appservers like JBoss provide their own logging facilities. Fighting it is just going to bring you pain.

like image 130
skaffman Avatar answered Nov 15 '22 12:11

skaffman