turn on debugging in Hibernate

Discussion in 'Java' started by Larry, Feb 20, 2007.

  1. Larry

    Larry Guest

    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.
     
    Larry, Feb 20, 2007
    #1
    1. Advertising

  2. 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
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Feb 20, 2007
    #2
    1. Advertising

  3. Larry

    Larry Guest

    On Feb 19, 10:19 pm, Arne Vajhøj <> 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.
     
    Larry, Feb 20, 2007
    #3
  4. Larry

    steen Guest

    On Feb 20, 3:57 am, "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.


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

    /Steen
     
    steen, Feb 20, 2007
    #4
  5. Larry wrote:
    > On Feb 19, 10:19 pm, Arne Vajhøj <> 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
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Feb 21, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ilias Lazaridis
    Replies:
    0
    Views:
    1,743
    Ilias Lazaridis
    Dec 27, 2004
  2. Replies:
    0
    Views:
    3,746
  3. jstorta
    Replies:
    1
    Views:
    11,804
  4. Eleanna Skouta
    Replies:
    2
    Views:
    8,464
    Arne Vajhøj
    Dec 9, 2008
  5. Amit Jain
    Replies:
    7
    Views:
    3,335
    Amit Jain
    Apr 27, 2009
Loading...

Share This Page