log4j2单独文件日志打印配置
1、创建一个单独的Appender <RollingFile name="TESTLOG" fileName="${LOG_PATH}/test_error.log" filePattern="${LOG_PATH}/test_error-%d{yyyyMMdd}-%i.log.gz"> <PatternLayout pattern="%d{yyyy/MM/dd HH:mm:ss.SSS} %t [%p] %c{1} (%F:%L) %msg%n" /> <Filters> <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/> </Filters> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true"/> <SizeBasedTriggeringPolicy size="256MB"/> </Policies> <DefaultRolloverStrategy> <Delete basePath="${LOG_PATH}" maxDepth="2"> <IfFileName glob="test_error-*.log.gz" /> <IfLastModified age="3d" /> </Delete> <