-->
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.  [ 1 post ] 
Author Message
 Post subject: Enabling Logging
PostPosted: Tue Aug 19, 2014 4:43 pm 
Newbie

Joined: Tue Aug 19, 2014 4:14 pm
Posts: 2
I would like to enable log4j logging using Hibernate 4.3.5 to see SQL query parameters. I have not been able to get any output. This is my log4j.properties

Code:
log4j.rootLogger=INFO, console
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.conversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.logger.org.hibernate=ALL, hb
log4j.logger.org.hibernate.SQL=TRACE
log4j.logger.org.hibernate.type=TRACE
log4j.logger.org.hibernate.engine.query=ALL
log4j.logger.org.hibernate.hql.ast.AST=ALL
log4j.logger.org.hibernate.tool.hbm2ddl=ALL
log4j.logger.org.hibernate.hql=ALL
log4j.logger.org.hibernate.cache=ALL
log4j.logger.org.hibernate.jdbc=ALL

log4j.appender.hb=org.apache.log4j.ConsoleAppender
log4j.appender.hb.layout=org.apache.log4j.PatternLayout
log4j.appender.hb.layout.ConversionPattern=HibernateLog --> %d{HH:mm:ss} %-5p %c - %m%n
log4j.appender.hb.Threshold=TRACE


I enabled log4j startup debug with the -Dlog4j.debug and this was the output

Code:
log4j: Trying to find [log4j.xml] using context classloader EnvironmentClassLoader[web-app:production/webapp/default/ROOT].
log4j: Trying to find [log4j.xml] using EnvironmentClassLoader[web-app:production/webapp/default/ROOT] class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader EnvironmentClassLoader[web-app:production/webapp/default/ROOT].
log4j: Using URL [file:/C:/resin-pro-4.0.37/webapps/ROOT/WEB-INF/classes/log4j.properties] for automatic log4j configuration.
log4j: Reading configuration from URL file:/C:/resin-pro-4.0.37/webapps/ROOT/WEB-INF/classes/log4j.properties
log4j: Parsing for [root] with value=[INFO, console].
log4j: Level token is [INFO].
log4j: Category root set to INFO
log4j: Parsing appender named "console".
log4j: Parsing layout options for "console".
log4j: Setting property [conversionPattern] to [%5p [%t] (%F:%L) - %m%n].
log4j: End of parsing for "console".
log4j: Parsed "console" options.
log4j: Parsing for [org.hibernate.jdbc] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.jdbc set to ALL
log4j: Handling log4j.additivity.org.hibernate.jdbc=[null]
log4j: Parsing for [org.hibernate.type] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.type set to ALL
log4j: Handling log4j.additivity.org.hibernate.type=[null]
log4j: Parsing for [org.hibernate.tool.hbm2ddl] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.tool.hbm2ddl set to ALL
log4j: Handling log4j.additivity.org.hibernate.tool.hbm2ddl=[null]
log4j: Parsing for [org.hibernate] with value=[ALL, hb].
log4j: Level token is [ALL].
log4j: Category org.hibernate set to ALL
log4j: Parsing appender named "hb".
log4j: Parsing layout options for "hb".
log4j: Setting property [conversionPattern] to [HibernateLog --> %d{HH:mm:ss} %-5p %c - %m%n].
log4j: End of parsing for "hb".
log4j: Setting property [threshold] to [TRACE].
log4j: Parsed "hb" options.
log4j: Handling log4j.additivity.org.hibernate=[null]
log4j: Parsing for [org.hibernate.SQL] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.SQL set to ALL
log4j: Handling log4j.additivity.org.hibernate.SQL=[null]
log4j: Parsing for [org.hibernate.hql] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.hql set to ALL
log4j: Handling log4j.additivity.org.hibernate.hql=[null]
log4j: Parsing for [org.hibernate.hql.ast.AST] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.hql.ast.AST set to ALL
log4j: Handling log4j.additivity.org.hibernate.hql.ast.AST=[null]
log4j: Parsing for [org.hibernate.engine.query] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.engine.query set to ALL
log4j: Handling log4j.additivity.org.hibernate.engine.query=[null]
log4j: Parsing for [org.hibernate.cache] with value=[ALL].
log4j: Level token is [ALL].
log4j: Category org.hibernate.cache set to ALL
log4j: Handling log4j.additivity.org.hibernate.cache=[null]
log4j: Finished configuring.


I've tried explicitly setting org.jboss.logging.provider=log4j
What am I missing?


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

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.