<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="600">
	<Properties>
		<Property name="LOG_HOME">${sys:catalina.home}/logs/sap</Property>
	</Properties>
	<Appenders>
		<Console name="console_appender" target="SYSTEM_OUT">
			<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
			<PatternLayout pattern="%5p [%t] %d{yyyy-MM-dd HH:mm:ss} (%F:%L) %m%n"/>
		</Console>
		<!-- INFO级别日志 -->
		<RollingRandomAccessFile name="info_appender" immediateFlush="true" fileName="${LOG_HOME}/info.log"
			filePattern="${LOG_HOME}/info/info - %d{yyyy-MM-dd HH_mm_ss}.log.gz">
			<PatternLayout>
				<pattern>%5p [%t] %d{yyyy-MM-dd HH:mm:ss} (%F:%L) %m%n</pattern>
			</PatternLayout>
			<Policies>
				<SizeBasedTriggeringPolicy size="10MB"/>
			</Policies>
			<Filters>
				<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/> 
			</Filters>
		</RollingRandomAccessFile>
		<!-- ERROR级别日志 -->
		<RollingRandomAccessFile name="error_appender" immediateFlush="true" fileName="${LOG_HOME}/error.log"
			filePattern="${LOG_HOME}/error/error - %d{yyyy-MM-dd HH_mm_ss}.log.gz">
			<PatternLayout>
				<pattern>%5p [%t] %d{yyyy-MM-dd HH:mm:ss} (%F:%L) %m%n</pattern>
			</PatternLayout>
			<Policies>
				<SizeBasedTriggeringPolicy size="10MB"/>
			</Policies>
			<Filters>
				<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
			  </Filters>
		</RollingRandomAccessFile>
	</Appenders>
	<Loggers>
		<!-- 配置日志的根节点 -->
		<root level="trace">
			<appender-ref ref="console_appender"/>
			<appender-ref ref="info_appender"/>
			<appender-ref ref="error_appender"/>
		</root>
		<!-- 第三方日志系统 -->
		<logger name="org.springframework.core" level="info"/>
		<logger name="org.springframework.beans" level="info"/>
		<logger name="org.springframework.context" level="info"/>
		<logger name="org.springframework.web" level="info"/>
		<logger name="org.apache.http" level="warn"/>
	</Loggers>
</Configuration>