<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="off">
	<Properties>
		<property name="log_home">./logs</property>
		<Property name="fileName">log-error</Property>
	</Properties>
	<Appenders>

		<Console name="console" target="SYSTEM_OUT">
			<PatternLayout
				pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} %L %M - %msg%xEx%n" />
		</Console>

		<RollingRandomAccessFile name="errorFile" fileName="${log_home}/${fileName}.log" 
			filePattern="${log_home}/${fileName}.%d{yyyy-MM-dd-HH}.log">
			<PatternLayout
				pattern="%date{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - %msg%n" />
			<Policies>
				<TimeBasedTriggeringPolicy interval="1" modulate="true" />
				<SizeBasedTriggeringPolicy size="30 MB" />
			</Policies>
			<Filters>
				<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY" />
			</Filters>
			<!-- 指定每天的最大压缩包个数，默认7个，超过了会覆盖之前的 -->
			<DefaultRolloverStrategy max="50" />
		</RollingRandomAccessFile>

	</Appenders>

	<Loggers>
		<root level="error">
			<appender-ref ref="console" />
			<appender-ref ref="errorFile" />
		</root>
	</Loggers>

</Configuration>