[logback-user] Changing Hibernate logging level

Olivier Catteau ocatteau at gmail.com
Sun Jan 23 12:47:29 CET 2011


Thanks for your advice Ceki.

I've found why it doesn't work. It was just a bug between my chair and my
computer... :)   My logback.xml file wasn't in the classpath.

Thanks !
Olivier


2011/1/23 Ceki Gülcü <ceki at qos.ch>

> Hi Olivier,
>
> Adding a status listener is usually a good idea:
>
> <configuration>
>  <statusListener
>      class="ch.qos.logback.core.status.OnConsoleStatusListener" />
>  ...
> </configuration>
>
> Then see what logback is telling you.
> HTH,
> --
> Ceki
>
>
> On 23/01/2011 10:47 AM, Olivier Catteau wrote:
>
>> Hello,
>>
>> I'd like to change Hibernate logging level to WARN.
>>
>> As explained on this page
>> <
>> http://docs.jboss.org/hibernate/core/3.5/reference/en/html/session-configuration.html#configuration-logging
>> >,
>>
>> you have to change the Hibernate Log Category "org.hibernate" to "WARN".
>> It works perfectly with log4j when I add
>> "log4j.logger.org.hibernate=WARN" to log4j.properties file.
>> But when I change slf4j dependency to use logback instead of log4j and
>> when I use the following logback.xml file, it doesn't work, I have
>> Hibernate debug logs. Could you help me, please ?
>>
>> <configuration>
>> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
>> <layout class="ch.qos.logback.classic.PatternLayout">
>> <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -
>> %msg%n</Pattern>
>> </layout>
>> </appender>
>>
>> <logger name="org.hibernate">
>> <level value="WARN"/>
>> </logger>
>>
>> <root level="DEBUG">
>> <appender-ref ref="STDOUT"/>
>> </root>
>> </configuration>
>>
>> Thanks.
>> Olivier
>>
>>
>>
>> _______________________________________________
>> Logback-user mailing list
>> Logback-user at qos.ch
>> http://qos.ch/mailman/listinfo/logback-user
>>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110123/12c5506c/attachment.html>


More information about the Logback-user mailing list