3

I'm trying to enable logging with slf4j 1.6.1 in JBoss 6.1 final and have run in to many problems, read many articles on Google and on here, and have ended up confused with logging still not working. The errors I get are either:

11:20:16,256 ERROR [STDERR] SLF4J: Failed to load class "org.slf4j.impl.StaticLo
ggerBinder".
11:20:16,256 ERROR [STDERR] SLF4J: Defaulting to no-operation (NOP) logger imple
mentation
11:20:16,256 ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#StaticLog
gerBinder for further details.

or

11:24:13,578 ERROR [STDERR] SLF4J: Class path contains multiple SLF4J bindings.
11:24:13,578 ERROR [STDERR] SLF4J: Found binding in [vfs:/C:/jboss-6.1.0.Final/c
ommon/lib/slf4j-jboss-logmanager.jar/org/slf4j/impl/StaticLoggerBinder.class]
11:24:13,578 ERROR [STDERR] SLF4J: Found binding in [vfs:/C:/jboss-6.1.0.Final/c
ommon/lib/slf4j-log4j12-1.6.1.jar/org/slf4j/impl/StaticLoggerBinder.class]
11:24:13,578 ERROR [STDERR] SLF4J: See http://www.slf4j.org/codes.html#multiple_
bindings for an explanation.

or I can manage to make these errors go away but still have no logging.

The first error block happens when I try putting slf4j-api-1.6.1.jar in [jboss home]/lib/endorsed as well as WEB-INF/lib and also common/lib

The second block happens when I delete the slf4j jar from 'endorsed' and have it only in common/lib and WEB-INF/lib. I then tried deleting the version inside the webapp's WEB-INF/lib folder and then there are no errors, but still no logging. I have tried going into jboss-logging.xml and changing the root-logger section to DEBUG and also creating a jboss-logging.xml file in my webapp's WEB-INF folder, with its own root logger set to DEBUG.

Despite all of this I still get no logs appearing, and I'm no longer sure which of these steps are compatible and if I'm still missing something. Any suggestions are appreciated!

user1111284
  • 886
  • 1
  • 6
  • 23
  • First things first, which implementation of SLF4J are you using? The API is just the interface specification, you need some implementation like Slf4j-Simple, or Logback. We'll get to the next steps after that. – Spencer Kormos Feb 10 '12 at 16:03
  • You also might want to check the related questions on stackoverflow: http://stackoverflow.com/questions/3414689/how-to-activate-slf4j-logging-in-jboss6-as and http://stackoverflow.com/questions/3419394/slf4j-logger-debug-does-not-get-logged-in-jboss-6 – Spencer Kormos Feb 10 '12 at 16:04
  • Ah yes, sorry about that. It's log4j 1.2.16 that we're using. – user1111284 Feb 13 '12 at 08:44
  • Have you enabled the appropriate logging level for your jboss instance? For Jboss 5 it is in `/conf/jboss-log4j.xml`. You need to enable the log level you want to be printed, INFO,DEBUG,etc.. – Rosdi Kasim Aug 08 '12 at 03:48

0 Answers0