-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Tools3.1.0 Beta and Logging
PostPosted: Tue Dec 06, 2005 12:23 am 
Newbie

Joined: Fri Oct 07, 2005 1:39 am
Posts: 17
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

HibernateTools 3.1.0beta:

I'm having lots of trouble trying to moderate the amount of debug trace I get on my eclipse console for hibernate. I recently upgraded to the latest Tools. The doumentation says output can be controlled via entries in the hibernate-log4j.properties.
I have modified this file, but I've found that nothing I do will stop the messages coming out.
Has anybody else had this issue?

Max, is it possible to obtain the code so I can try and see what is happening.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 12:44 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
what did you change in log4j.properties?

you can get the code from sorceforge, it's an OS project ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 6:48 pm 
Newbie

Joined: Fri Oct 07, 2005 1:39 am
Posts: 17
Firstly, I changed debug entry to info.
Then I commneted out the sql entry. However, whatever I tried didn't seem to make a difference.
It appears as if I'm placing this file in the wrong location and hibernate defaults to verbosity.
I place the file in the same directory as the org.hibernate.eclipse.jar (as per the notes).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 6:55 pm 
Newbie

Joined: Fri Oct 07, 2005 1:39 am
Posts: 17
Firstly, I changed debug entry to info.
Then I commneted out the sql entry. However, whatever I tried didn't seem to make a difference.
It appears as if I'm placing this file in the wrong location and hibernate defaults to verbosity.
I place the file in the same directory as the org.hibernate.eclipse.jar (as per the notes).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 7:15 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
is there another .properties file in somewhere in the classpath ;) ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 7:36 pm 
Newbie

Joined: Fri Oct 07, 2005 1:39 am
Posts: 17
No there is isn't.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 9:12 pm 
Newbie

Joined: Fri Oct 07, 2005 1:39 am
Posts: 17
Apologies. I have found a log4j.properties in the calss path.
I have found that removing this, I get the warning message about the logging system not being initialised properly.

Does this mean that hibernate-log4j.properties file is not being read (i.e. is in the wrong location).

Which proeprties file should be used:
1. log4.properties
2. hibernate-log4j.properties
3.both


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 2:22 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
I have no idea what hibernate-log4j.properties is for. That doesn't mean you should stop using it. But I do know you will have no problem configuring the logging w/ a single log4j.properties file in the classpath.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 2:28 am 
Newbie

Joined: Fri Oct 07, 2005 1:39 am
Posts: 17
Thanks Dennis.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 12:27 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 5:26 am
Posts: 25
Location: Adelaide, South Australia
dennisbyrne wrote:
I have no idea what hibernate-log4j.properties is for. That doesn't mean you should stop using it. But I do know you will have no problem configuring the logging w/ a single log4j.properties file in the classpath.


From the current documentation:
Quote:
This is done by editing the "hibernate-log4j.properties" in org.hibernate.eclipse/ directory/jar. This file includes a default configuration that only logs WARN and above to a set of custom appenders (PluginFileAppender and PluginLogAppender).


The HibernateTools-3.1.0.beta4 .jar file contains no hibernate-log4j.properties file.

I have read the documentation - can someone give a concise example of how we get the logging working?

(In any normal situation with ant a log4j.properties in the root of the classpath would normally to the trick, but apparently not here).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 5:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you just edit or create a org.hibernate.eclipse/hibernate-log4j.properties then it will work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 6:39 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 5:26 am
Posts: 25
Location: Adelaide, South Australia
max wrote:
if you just edit or create a org.hibernate.eclipse/hibernate-log4j.properties then it will work.


Okay - I'm clearly stupid or something.

My build script:

Code:
  <path id="hibernate-tools-classpath">
   <pathelement location="${lib}/hibernate-tools.jar"/>
   <pathelement location="${lib}/velocity-1.4.jar"/>
   <pathelement location="${lib}/velocity-tools-generic-1.1.jar"/>
   <pathelement location="${lib}/jtidy-r8-21122004.jar"/>
   <pathelement location="${lib}/hibernate3.jar"/>
   <pathelement location="${lib}/ojdbc14.jar"/>
   <pathelement location="${lib}/commons-logging.jar"/>
   <pathelement location="${lib}/dom4j-1.6.1.jar"/>
   <pathelement location="${lib}/ehcache-1.1.jar"/>
   <pathelement location="${lib}/commons-collections-3.0.jar"/>
   <pathelement location="${lib}/cglib-nodep-2.1_3.jar"/>
     <pathelement location="."/>
  </path>
   
  <target name="init">
  </target>

  <target name="clean">
   <delete verbose="true" dir="${publishto}"/>
</target>
   
  <target name="export" >

     <echo>Looking for libraries in ${lib}</echo>

     <taskdef
          name="hibernatetool"
          classname="org.hibernate.tool.ant.HibernateToolTask">
        <classpath>
           <path refid="hibernate-tools-classpath"/>
        </classpath>
   </taskdef>
 
     <hibernatetool destdir="${publishto}">
        <classpath>
           <path refid="hibernate-tools-classpath"/>
        </classpath>
      <jdbcconfiguration configurationfile="hibernate.cfg.xml" revengfile="hibernate.reveng.xml" />   
        <hbm2java jdk5="false" ejb3="false"/>
      <hbm2hbmxml/>
      <hbm2doc/>
   </hibernatetool>

  </target>


The jar files are being read correctly as the process actually does run.

The working directory (".") contains:
Code:
build.xml
hibernate.cfg.xml
hibernate.reveng.xml
org/hibernate/eclipse/hibernate-log4j.properties


hibernate-log4j.properties looks like:
Code:
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %c - %m\n

log4j.rootCategory=DEBUG,console

log4j.category.org.hibernate=DEBUG, console
log4j.additivity.org.hibernate=false



I'm still simply not able to control the output of the logging.

(Which I need to be able to do to explain why certain database types aren't being converted to Java types as expected).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 6:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
this is pure ant, the hibernate-log4j.properties is only for controlling the plugins logging.

just put a log4j.properties in the root of the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 7:13 pm 
Beginner
Beginner

Joined: Fri Jun 10, 2005 5:26 am
Posts: 25
Location: Adelaide, South Australia
max wrote:
this is pure ant, the hibernate-log4j.properties is only for controlling the plugins logging.

just put a log4j.properties in the root of the classpath.


As indicated earlier in the thread - with the above layout and simply adding the log4j.properties to the root of the classpath (ie: "." as above) it doesn't work.

The contents of log4j.properties are as above.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 23, 2006 7:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and you are 100% sure "." resolves to what you expect to be the right directory ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.