turn on debugging in Hibernate

L

Larry

I know there is some way to make Hibernate dump out lots of debugging
info about what it's doing, but I can't figure out how to turn that
on. I saw something on the web about log4j.properties, but I searched
the whole hard disk of my dev machine and can't find that file.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Larry said:
I know there is some way to make Hibernate dump out lots of debugging
info about what it's doing, but I can't figure out how to turn that
on. I saw something on the web about log4j.properties, but I searched
the whole hard disk of my dev machine and can't find that file.

Make one !

Use -Dlog4j.configuration=file:///C:/log4j.properties to
tell log4j where it is if it can not find it.

BTW putting

<property name="show_sql">true</property>

in your hibernate config xml could be all you need.

Arne
 
L

Larry

Make one !

Use -Dlog4j.configuration=file:///C:/log4j.properties to
tell log4j where it is if it can not find it.

Where do I add that -D line? I don't start log4j explicity. The only
place I see it is as a JAR file.
BTW putting

<property name="show_sql">true</property>

in your hibernate config xml could be all you need.

Sometimes that's not enough for me to see what's going on, when
something is not working right.
 
S

steen

I know there is some way to make Hibernate dump out lots of debugging
info about what it's doing, but I can't figure out how to turn that
on. I saw something on the web about log4j.properties, but I searched
the whole hard disk of my dev machine and can't find that file.

Place the log4j.properties file in your classpath, ie. if your
application is a web-application, put it in WEB-INF/classes, etc

/Steen
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Larry said:
Where do I add that -D line? I don't start log4j explicity. The only
place I see it is as a JAR file.

It is not for starting log4j but for starting the JVM that runs your
app.

If you place it the right place then log4j can find it without,
but unless it is within an app server doing it explicit is
usually easier.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top