[logback-user] Can't set level (logback.classic-0.9.9)

Ceki Gulcu ceki at qos.ch
Mon Jul 13 18:14:40 CEST 2009


Hello,

0.9.9 is the reason. Only logback versoins 0.9.12 and later accept level as an 
attribute:

<root level="error">
   ...
</root>

for "older" versions, the level has be specified as an element:

<root>
    <level>error</level>
</root>

Of course, logback versions 0.9.12 honor the old format as well. In any case, 
level values are case insensitive.

HTH,

Neale Upstone wrote:
> Hi,
> 
> Tried CAPS, and that doesn't work.  I'm using 0.9.9 as I want to use the 
> Eclipse plugin.
>  
> Cheers,
> 
> Neale
> 
> ------------------------------------------------------------------------
> *From:* logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] 
> *On Behalf Of *Joern Huxhorn
> *Sent:* 10 July 2009 21:30
> *To:* logback users list
> *Subject:* Re: [logback-user] Can't set level
> 
> 
> On 10.07.2009, at 18:03, Neale Upstone wrote:
> 
>> Hi,
>> I've been trying the examples at 
>> http://logback.qos.ch/manual/configuration.html and the level 
>> attribute is always ignored.
>> i.e. the following should ensure that I only get error messages logged:
>> <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>
>>
>>   <root level="error">
>>     <appender-ref ref="STDOUT" />
>>   </root>
>> </configuration>
>> This is quite frustrating, especially as there is no DTD (which would 
>> also provide documentation and the ability to edit config files 
>> confidently in an XML editor, as is simple with Spring configs).
>> Can anyone help.
>> Cheers,
>>
>> Neale
>>
> 
> Try using  <root level="ERROR">, i.e. capital letters.
> Just a guess, HTH
> 
> Regards,
> Joern.
> 
> 
-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch


More information about the Logback-user mailing list