Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   turn on debugging in Hibernate (http://www.velocityreviews.com/forums/t390980-turn-on-debugging-in-hibernate.html)

Larry 02-20-2007 02:57 AM

turn on debugging in Hibernate
 
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?= 02-20-2007 03:19 AM

Re: turn on debugging in Hibernate
 
Larry wrote:
> 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 02-20-2007 03:49 PM

Re: turn on debugging in Hibernate
 
On Feb 19, 10:19 pm, Arne Vajh°j <a...@vajhoej.dk> wrote:
> Larry wrote:
> > 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.


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.


steen 02-20-2007 07:53 PM

Re: turn on debugging in Hibernate
 
On Feb 20, 3:57 am, "Larry" <larry.grant...@gmail.com> wrote:
> 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?= 02-21-2007 03:26 AM

Re: turn on debugging in Hibernate
 
Larry wrote:
> On Feb 19, 10:19 pm, Arne Vajh°j <a...@vajhoej.dk> wrote:
>> Larry wrote:
>>> 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.

>
> 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


All times are GMT. The time now is 12:03 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.