<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug">
<Properties>
<property name="log_pattern">%d{yyyy-MM-dd HH:mm:ss z} %-5level %class{36} %L %M - %msg%xEx%n</property>
<property name="file_name">/home/chat/chatClient/chatClient.log</property>
<property name="rolling_file_name">/home/chat/chatClient/chatClient-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="every_file_size">10M</property><!-- 日志切割的最小单位 -->
<property name="output_log_level">info</property><!-- 日志输出级别 -->
</Properties>
<Appenders>
<Console name="console" target="SYSTEM_OUT">
<!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)-->
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
<!--这个都知道是输出日志的格式-->
<PatternLayout pattern="${log_pattern}"/>
</Console>
<RollingFile name="RollingFile" fileName="${file_name}" filePattern="${rolling_file_name}">
<PatternLayout pattern="${log_pattern}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>
<Filters>
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>
</Appenders>
<Loggers>
<root level="${output_log_level}">
<appender-ref ref="RollingFile"/>
<appender-ref ref="console"/>
</root>
</Loggers>
</Configuration>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…