/ Published in: Java
ch.qos.logback
logback-classic
0.9.8
logback-classic
0.9.8
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?xml version="1.0" encoding="UTF-8" ?> <configuration> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%-4relative [%thread] %-5level %class - %msg%n</pattern> </layout> </appender> <!--Basic file appender<appender name="FILE" class="ch.qos.logback.core.FileAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <pattern>%-4relative [%thread] %-5level %class - %msg%n</pattern> </layout> <File>sample-log.txt</File> </appender>--> <!--Daily rolling file appender --> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>logFile.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>logFile.%d{yyyy-MM-dd}.log</FileNamePattern> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern> </layout> </appender> <logger name="deng.mysimpleapp"> <level value="debug" /> </logger> <root> <level value="error" /> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root> </configuration>