[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2835?page=c...
]
Jeremy Grodberg commented on HHH-2835:
--------------------------------------
I've figured out what's going on. This is the Hibernate team's choice as to
whether this is an implementation issue or a documentation issue, but I guess it is the
latter.
It appears that at least since Hibernate3 was first officially released (probably in
Hibernate2 as well, I didn't check) the "org.hibernate.type" logging was
done not at the "debug" level but rather at the "trace" level.
However, prior to log4j 1.2.12 log4j did not support a trace level and treated
"trace" as synonymous with "debug". Hibernate still ships with log4j
1.2.11 (perhaps because of this very issue?). I was confused because we switched over to
log4j 1.2.13 (from 1.2.9) at the same time we switched over to annotations.
The documentation around table 3.9 doesn't actually specify what level of logging to
set for org.hibernate.type, but rather points the reader to the example log4j.properties
file in the Hibernate src/ directory (in the Hibernate distribution). That file is no
longer in src/ but now is in etc/ and in that file the log level for "type" is
set to info, with a debug (not trace) setting commented out. Likewise the FAQ answer for
"how do I configure logging" at
http://www.hibernate.org/119.html#A17 says
"Just change INFO to DEBUG to see more messages" which of course works fine if
you also follow the suggestion to use the version of log4j shipped with Hibernate, but not
if you use a later version (note that log4j 1.2.12 was relased over 2 years ago). Last
but not least, the Hibernate3 JBoss and XDoclet tips page at
http://www.hibernate.org/282.html says "Turn on DEBUG logging for org.hibernate.type
to get a better idea of what the problem really is."
My request is that you update the documentation in 3 places:
(1) Section 3.5 of the Hibernate Reference Documentation
(2) The configuration FAQ answer under Miscellaneous FAQs at
http://www.hibernate.org/119.html#A17
(3) The log4j.properties file in etc/ in the source distribution
I've already updated the Hibernate3 JBoss and XDoclet tips at
http://www.hibernate.org/282.html
In the Reference Documentation, I request you correct the location of the log4j.properties
file and add something like this: "Hibernate uses both TRACE level and DEBUG level
logging. Some logging libraries treat TRACE and DEBUG as the same (notably log4j prior to
version 1.2.12) while others honor the difference. Set the logging level to TRACE if you
want to be sure to get everything possible. "
Update the FAQ with something like "Just change INFO to DEBUG or even TRACE to see
more messages" instead of "Just change INFO to DEBUG."
FYI, Hibenrate 3.2.5.ga calls log.trace() in 287 places according to Eclipse.
OR, ALTERNATELY, just change the logging in org.hibernate.type.NullableType to be at the
debug rather than the trace level.
Setting org.hibernate.type logging to debug produces no logging
---------------------------------------------------------------
Key: HHH-2835
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2835
Project: Hibernate3
Issue Type: Bug
Components: core, documentation
Affects Versions: 3.2.4, 3.2.5
Environment: Hibernate 3.2.4.ga and Hibernate 3.2.5.ga with MySQL5Dialect
(configured with Hibernate Annotations 3.3.0.ga and Spring 2.0.6)
Reporter: Jeremy Grodberg
Priority: Minor
According to the online documentation (labeled as version 3.2.2 at this moment), Table
3.9 "Hibernate Log Categories", as viewed here today:
http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...
Setting the log4j category "org.hibernate.type" to debug should "Log all
JDBC parameters". However, it produces no output at all.
When I go on to set "org.hibernate" to debug, I get output like this:
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open
PreparedStatements: 0, globally: 0)
DEBUG: org.hibernate.SQL - select count(*) from album where genreID=?
DEBUG: org.hibernate.loader.Loader - bindNamedParameters() 126 -> genreId [1]
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0,
globally: 0)
DEBUG: org.hibernate.loader.Loader - result row:
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to close ResultSet (open ResultSets: 1,
globally: 1)
DEBUG: org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open
PreparedStatements: 1, globally: 1)
Note that the JDBC parameters are logged under org.hibernate.loader but nothing appears
under org.hibernate.type. FYI, genreId is, in this case, a Long.
Perhaps this is expected/desired when using annotations? If so, then please update the
documentation. If not, please restore the logging.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira