Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

turn on debugging in Hibernate

Thread view: 
Larry - 20 Feb 2007 02:57 GMT
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.
Arne Vajhøj - 20 Feb 2007 03:19 GMT
> 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
Larry - 20 Feb 2007 15:49 GMT
> > 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
[quoted text clipped - 5 lines]
> 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.
Arne Vajhøj - 21 Feb 2007 03:26 GMT
>>> 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
[quoted text clipped - 7 lines]
> 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
steen - 20 Feb 2007 19:53 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.