[logback-user] exclude a logger in root logger

yxx yxxcrtd at gmail.com
Sat Oct 16 14:10:59 CEST 2010


<appender name="Log"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/UserMgr.${byDay}.log</file>
-
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>${catalina.base}/logs/UserMgr.${byDay}.%i.zip
</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>5</MaxIndex>
</rollingPolicy>
-
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>2MB</MaxFileSize>
</triggeringPolicy>


Separate by size, enjoy.

2010/10/16 Ceki Gülcü <ceki at qos.ch>

> Hello,
>
> Have a look at
> http://logback.qos.ch/manual/configuration.html#cumulative
> and
> http://logback.qos.ch/manual/configuration.html#overrridingCumulativity
>
> HTH,
>
> On 14/10/2010 12:58 PM, LongkerDandy wrote:
>
>> Hi
>>
>> I've write a config like this
>>
>> <configuration>
>>
>> <appender name="Chii2FILE" class="ch.qos.logback.core.FileAppender">
>> <file>log/chii2.log</file>
>>
>> <encoder>
>> <pattern>%date{yyyy-MM-dd HH:mm:ss} [%level] %logger{50} [%file:%line]
>> %msg%n</pattern>
>> </encoder>
>> </appender>
>>
>> <appender name="FILE" class="ch.qos.logback.core.FileAppender">
>> <file>log/platform.log</file>
>>
>> <encoder>
>> <pattern>%date{yyyy-MM-dd HH:mm:ss} [%level] %logger{50} [%file:%line]
>> %msg%n</pattern>
>> </encoder>
>> </appender>
>>
>> <logger name="org.chii2" level="debug">
>> <appender-ref ref="Chii2FILE"/>
>> </logger>
>>
>> <root level="warn">
>> <appender-ref ref="FILE" />
>> </root>
>>
>> </configuration>
>>
>> The problem is, all the log in chii2.log will repeat in platform.log.
>> I want separate my project's log from others.
>> How can I do that?
>>
>> Regards
>> LongkerDandy
>>
>>  _______________________________________________
> 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/20101016/10056ec6/attachment.html>


More information about the Logback-user mailing list