-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate logging in websphere
PostPosted: Fri Apr 13, 2007 1:28 pm 
Newbie

Joined: Fri Apr 13, 2007 11:38 am
Posts: 1
Hi,

I have a standalone java application. I am using using Log4j which is redirecting the logs to a file. I get all the hibernate debugs as required.

The problem is that when I run this application using the Websphere app server, the hibernate logs are not displayed. I have also set the property
<prop key="hibernate.show_sql">true</prop>

Is there something other place where I have to set some configuration parameter to get this to work with Websphere?

Thanks !!

Here is my Log4j.properties file -
### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p %c{1}:%L - %m%n

### direct messages to file ###
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=/ecs/test/logs/XML.log
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
#log4j.appender.file.MaxFileSize=100KB

### set log levels - for more verbose logging change 'info' to 'debug'
log4j.rootLogger= debug, file
#log4j.rootLogger=debug, stdout

#log4j.logger.org.hibernate=info
log4j.logger.org.hibernate=debug

### log HQL query parser activity
#log4j.logger.org.hibernate.hql.ast.AST=debug

### log just the SQL
log4j.logger.org.hibernate.SQL=debug

### log JDBC bind parameters ###
#log4j.logger.org.hibernate.type=debug
log4j.logger.org.hibernate.type=debug

### log schema export/update ###
log4j.logger.org.hibernate.tool.hbm2ddl=debug

### log HQL parse trees
log4j.logger.org.hibernate.hql=debug

### log cache activity ###
log4j.logger.org.hibernate.cache=debug

### log transaction activity
log4j.logger.org.hibernate.transaction=debug

### log JDBC resource acquisition
log4j.logger.org.hibernate.jdbc=debug

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 13, 2007 2:23 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
Congrats! You have found one of the most annoying things about Websphere! Websphere hard codes commons-logging to do all logging to the JDK logger. The easy answer, use commons-logging and forget about log4j. There are other solutions (I hacked the common-logging.properties file out of their JAR), and you can google up Wesphere and log4j to find them.

BTW, I'm also glaring at you JBoss people for doing something equally as evil...log4j.xml indeed >:[ .


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.