15

I am using Hibernate 4.0 and Coldfusion 8 with Jrun which unfortunately has log4j already included and I can't remove it and the version of log4j is too old (no trace). Therefore Hibernate can't work. I would like to force Jboss Logging to use SLF4j for which I have added a binding to a custom log4j.

Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
Abbadon
  • 2,513
  • 3
  • 25
  • 33
  • possible duplicate of [How do you configure logging in Hibernate 4?](http://stackoverflow.com/questions/11639997/how-do-you-configure-logging-in-hibernate-4) – Raedwald Dec 15 '14 at 11:15

1 Answers1

19

I can't remember off the top of my head which version of JBoss Logging this was in, but try adding a system property of org.jboss.logging.provider=slf4j. Note though it will only work if you're using logback as well since SLF4J is only a facade like JBoss Logging not a log manager.

The Alchemist
  • 3,397
  • 21
  • 22
James R. Perkins
  • 16,800
  • 44
  • 60
  • Thx I figured it out just before reading your answer... I am using a custom version of Log4j and a custom Log4j binding for slf4j to avoid using default log4j! – Abbadon Feb 07 '13 at 07:54
  • no need for logback if you use that property, it's one or the other. – jwenting May 31 '13 at 19:36
  • Look to my answer: http://stackoverflow.com/questions/11639997/how-do-you-configure-logging-in-hibernate-4/19488546#19488546 – gavenkoa Oct 21 '13 at 07:34
  • I added this system property to glassfish (3.x) and it broke the admin console (reproducible). I have to manually remove it from the domain.xml. I will search for another solution :) – Paul S Jun 10 '14 at 10:50
  • @PaulS Are you using JBoss Logging? AFAIK Glassfish uses J.U.L. I'm not sure how logback works with Glassfish. – James R. Perkins Jun 10 '14 at 15:53
  • @JamesR.Perkins Apparently one of my projects dependencies is depending on logback, and assumed it was provided when it wasn't. Glassfish indeed does not have logback on its classpath by default, but if I add it to the war file (or put it on the classpath in another way) it works fine. – Paul S Jun 11 '14 at 09:07