1

I have been looking for hours for a solution.

How can I change the logging level in Hibernate 4.3.6 to DEBUG?

In the official documentation it is mentioned that

Completely out of date. Hibernate uses JBoss Logging starting in 4.0. This will get documented as we migrate this content to the Developer Guide.

I have not found anything in the Developer Guide so I assume that they have not even started to document it.

The Stackoverflow post here does not help me at all. I am using Hibernate 4 as a standalone library and I do not care for any Maven, JBoss or whatever else there might be XML file.

Is there somewhere a comprehensive tutorial on how I can change the debugging level in the newest version of Hibernate?

Community
  • 1
  • 1
Jagger
  • 10,350
  • 9
  • 51
  • 93
  • Sorry, but this is not a duplicate. The other post does not solve anything at all. There is just a link to some JBoss code but there is no real solution to the problem. – Jagger Sep 04 '14 at 06:51
  • The OP is not interested in using SLF4J, they just want to change the logging level. – Raedwald Dec 16 '14 at 21:13

2 Answers2

3

Firstly, sorry for overlooking the question. I'll delete the comment right away.

I think they've migrated the guide but forgot to update the page. Note on the new userguide says:

This is still very much a work in progress. Help is definitely welcome!

Logging Guide states that "This is largely the seminal documentation of JBoss Logging since JBoss Logging currently provides no documentation of its own." unfortunately.

But there are some helpful tips:

First, JBoss Logging will look for a System setting with the key org.jboss.logging.provider, which can be set to one of the following values:
-jboss
-jdk
-log4j2
-log4j
-slf4j

Next, JBoss Logging will look for a JDK service (see javadocs for java.util.ServiceLoader for details) for its "provider" contract (org.jboss.logging.Provider). If multiple are available, it will use the first one returned by the ClassLoader.

If you want to use JBoss Logging backed by another logging library you need to put their libraries on your classpath. After that you can use related configuration file(logback.xml, log4j.properties etc) to define your logging level for org.hibernate.

Community
  • 1
  • 1
GokcenG
  • 2,771
  • 2
  • 25
  • 40
  • Thank you ! Many dependencies transitively bring their logger, so we need to exclude them (in intellij idea you can easily see what dependencies bring logger libraries, to add exclusions in maven) – Pleymor Mar 03 '17 at 16:02
0

See if this post can help your issue. I have created this post earlier where I faced same issue. By placing log4j.properties and placing the slf4j jar file in classpath has fixed my issue. I am also using Hibernate 4.3.6

Community
  • 1
  • 1
Chaitanya
  • 15,403
  • 35
  • 96
  • 137
  • Unfortunately this does not work. Putting `slf4j` and `log4j.properties` does not change anything. What is loaded by Hibernate 4.3.6 is `jboss-logging-3.1.3.GA.jar` which contains the default logger for this Hibernate's version. – Jagger Sep 03 '14 at 18:11
  • Sorry to ask once again, have you tried it? because I am also using `Hibernate 4.3.6` and it worked for me. – Chaitanya Sep 03 '14 at 18:12