-->
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.  [ 3 posts ] 
Author Message
 Post subject: Need help getting hibernate log4j logging to work - WSAD
PostPosted: Tue Jun 21, 2005 1:24 pm 
Newbie

Joined: Sat Jun 11, 2005 8:35 am
Posts: 14
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5

Mapping documents: n/a

Code between sessionFactory.openSession() and session.close(): n/a

Full stack trace of any exception that occurs: n/a

Name and version of the database you are using: DB2 8.2.1

The generated SQL (show_sql=true): n/a

Debug level Hibernate log excerpt:

I am running Hibernate in a WAS 5.1 test server within WSAD 5.1.2. I have log4j and commons-logging jars in the web project classpath. Our own application code uses log4j directly (not commons apis) and works just fine - i.e. I can turn on or off the debug level as needed.

But it looks like WAS's use of commons-logging is preventing me from getting Hibernate to use log4j - Hibernate's log messages come out looking like the test server in terms of format - and not at all with the pattern layout that I have specified in our log4j.properties file. This is a sample of what the Hibernate log message looks like vs one from our application:

[6/21/05 13:21:35:831 EDT] 3d3a21a2 SessionFactor I org.hibernate.impl.SessionFactoryImpl Checking 3 named queries
[INVSVCS] [ BootStrapServlet:: init( 93)] [06/21 13:21:35] [DEBUG] [SEVERITY 4] Putting the Hibernate main session factory into the AppContext object...

Has anyone worked around this problem and been able to get Hibernate to at least log at debug level within WSAD using the WAS 5.1 test server?

I don't need this often but ever now and then it would be helpful to get this level of detail from Hibernate.

_________________
Regards,

Scott Jacobs
srj@mindspring.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 3:03 pm 
Newbie

Joined: Tue May 10, 2005 2:22 pm
Posts: 10
WebSphere uses Commons Logging and supplies its own log Factory implementation so by default, you would only see INFO and ERROR messages in the WAS console. To override WAS so you have control over the format and get DEBUG messages in the console, add a file called "org.apache.commons.logging.LogFactory" to your web application's META-INF/services. In that file, add the line:

org.apache.commons.logging.impl.LogFactoryImpl

There's a document describing all the details (PDF):

http://www-1.ibm.com/support/docview.ws ... 4610&aid=1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 21, 2005 7:09 pm 
Newbie

Joined: Sat Jun 11, 2005 8:35 am
Posts: 14
Great! - That's exactly what I was looking for!

_________________
Regards,

Scott Jacobs
srj@mindspring.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

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.