1
|
compile 'ch.qos.logback:logback-classic:1.1.3'
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<?xml version="1.0"?> <configuration scan="true" scanPeriod="30 seconds"> <property name="logDir" value="/temp/logs"/>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>[%d{yyyy-MM-dd HH:mm:ss}] [%-5level] [%F-%M:%L] - %msg%n</pattern> </encoder> </appender>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender"> <encoder> <pattern>[%d{yyyy-MM-dd HH:mm:ss}] [%-5level] [%F-%M:%L] - %msg%n</pattern> </encoder>
<file>${logDir}/log.txt</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${logDir}/log_%d{yyyyMMdd}.log</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> </appender>
<root level="info"> <appender-ref ref="stdout"/> <appender-ref ref="file"/> </root>
<logger name="org.apache.ibatis.io" level="off"/> <logger name="org.springframework" level="info"/> <logger name="org.mybatis" level="off"/> <logger name="com.xtuer.mapper" level="off"/> </configuration>
|
http://unmi.cc/jcl-over-slf4j-slf4j/
http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedFNATP
http://blog.csdn.net/mydeman/article/details/6716925
http://www.360doc.com/content/12/0321/13/203871_196275021.shtml