logBack

logback.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
	<timestamp key="byDay" datePattern="yyyy-MM-dd"/>
	<!-- output to file -->
	<appender name="RootFileAppender" class="ch.qos.logback.core.FileAppender">
		<file>c:/log/logs.log</file>
		<append>true</append>
		<layout class="ch.qos.logback.classic.PatternLayout">
			<pattern>%d{yyyy-MM-dd HH:mm:ss}, %p, %c, %t, %F, %L, %C{1}, %M %m%n</pattern>
		</layout>
		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
			<level>debug</level>
		</filter>
	</appender>
	<!-- output to file -->
	<!-- <appender name="RootConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
		<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
			<level>debug</level>
		</filter>
		<layout class="ch.qos.logback.classic.PatternLayout">
			<pattern>%d{yyyy-MM-dd HH:mm:ss}, %p, %c, %t, %F, %L, %C{1}, %M %m%n</pattern>
		</layout>
	</appender> -->
	<root>
		<level value="debug"/>
		<appender-ref ref="RootFileAppender"/>
		<!-- <appender-ref ref="RootConsoleAppender"/> -->
	</root>
</configuration>
 

你可能感兴趣的:(logback)