logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: Log4j not logging hibernate
Date Tue, 25 Aug 2009 04:01:00 GMT
>From reading some of the SLF4J posts, it seems that Hibernate uses SLF4J.  Could
it be that you have to install the correct binding to route hibernate logs to Log4j?

Jake

On 8/24/2009 2:31 AM, aabra1 wrote:
> Did u ever figure it out?
> My custom packages logging is controlled fine but I cannot seem to control
> anything from org.hibernate.
> Same problem as yours.
> 
> 
> 
> 
> wild_oscar wrote:
>> I will try it, although I do not believe that should be a problem - I have
>> my Log Servlet set to pick up the log4j.properties file from the /lib
>> directory. And all other properties (for instance, changing the log level
>> of my custom packages) are working well (eg, turning off the log for my
>> packages works). 
>>
>> Jacob Kjome wrote:
>>>
>>> The WEB-INF/lib folder is not added to the classpath.  Each jar in said
>>> folder is 
>>> but not the folder itself.  You need to put it in WEB-INF/classes.  I
>>> assume you 
>>> are using Tomcat standalone, with child-first classloading?  Then if you
>>> put 
>>> log4j.jar in WEB-INF/lib, it should pick up log4j.properties from
>>> WEB-INF/classes, 
>>> unless you have log4j.xml somewhere in the root package on the classpath,
>>> as 
>>> log4j.xml is used in preference to log4j.properties.
>>>
>>>
>>> Jake
>>>
>>> wild_oscar wrote:
>>>> My current log4j properties file has the following input regarding
>>>> Hibernate:
>>>>
>>>> [code]
>>>> 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=%d{ABSOLUTE} %5p %c{1}:%L
>>>> -
>>>> %m%n
>>>>
>>>> log4j.rootLogger=warn, stdout
>>>> #log4j.logger.org.hibernate=info
>>>> #log4j.logger.org.hibernate=DEBUG
>>>> log4j.logger.org.hibernate=debug, stdout 
>>>> log4j.logger.org.hibernate.SQL=debug, stdout
>>>> log4j.logger.org.hibernate.type=info, stdout
>>>> log4j.logger.org.hibernate.engine.QueryParameters=debug 
>>>> [/code]
>>>>
>>>> and the file is in the lib folder of my web application.
>>>>
>>>> Unfortunately, I cannot get any Hibernate logs on my tomcat logging file
>>>> unless I explicitly set the attribute
>>>>
>>>> 		        <property name="show_sql">true</property> 
>>>>
>>>> on my hibernate.cfg.xml file. (and I can't get my queryparameters, on
>>>> which
>>>> I am interested in).
>>>>
>>>> Can anyone help me understand what am I doing wrong for the hibernate
>>>> not
>>>> being logged?
>>>> Thank you for your replies!
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>
>>>
>>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message