2
votes

I had configured my application to use slf4j with log4j, but some how JBoss logger is being selected over slf4j:

org.jboss.logging [DEBUG] Logging Provider: org.jboss.logging.Log4jLoggerProvider.

My application uses spring and hibernate and as I understand it, hibernate now uses JBoss logger instead of slf4j. Is there away for me to force the use of slf4j? Or better yet, make my logging calls API agnostic? As it stands now, hibernate and spring log correctly, but my application specific logging is ignored since it uses the slf4j API.

UPDATE: Logging related jars (which are managed by maven) include:

  1. slf4j-api-1.6.1
  2. slf4j-parent-1.6.1
  3. slf4j-simple-1.6.1
  4. slf4j-log4j12-1.6.1
  5. jboss-logging-3.1.0.CR2
  6. log4j-1.2.12

Thanks.

1
can you add the list of the logging-related jars you put in your webapp's WEB-INF/lib?foch

1 Answers

2
votes

You have too many logging implementations in your classpath.

Apparently Hibernate uses SLF4J: documentation

So you should remove the following jars:

  • slf4j-simple-1.6.1 (it conflicts with slf4j-log4j)
  • jboss-logging-3.1.0.CR2

I'm not so sure what slf4j-parent-1.6.1 is, you can try with and without it.