
Hi, I found the solution. <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> <Encoding>UTF-8</Encoding> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>error.%d{yyyy-MM-dd}.log</FileNamePattern> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern><![CDATA[%-4relative [%thread] %-5level %logger{30} - %msg%n]]></Pattern> </layout> </appender> <root> <appender-ref ref="ERROR" /> </root> Thnaks. --- lunch716@yahoo.co.jp wrote:
Hi,
I'm using logback core and classic(both version are 0.9.9) with jdk5.0. My goal is to generate a log file per log level.Namely error.log is for error level and warn.log is for warn level and so on.
I found the following thread though,
http://marc.info/?l=logback-user&m=125052059800553&w=2
I could not create the LevelBasedDiscriminator class because I could not find the classes below on logback 0.9.9.
ch.qos.logback.classic.sift.SiftingAppender ch.qos.logback.core.sift.Discriminator ch.qos.logback.classic.spi.ILoggingEvent
I have two questions. Q1.Is it possible to create log files per log level? Q2.If I have to give up the use of SiftingAppender,how can I accomplish my goal?
-------------------------------------- Learn more about breast cancer - Pink Ribbon Campaign 2010 http://yj.pn/JAy9L7 _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-------------------------------------- Learn more about breast cancer - Pink Ribbon Campaign 2010 http://yj.pn/JAy9L7