Zio*_*ion 3 java apache logging log4j2
我在log4j 2中有一个关于RollingFile Appender的Filepattern的问题。RollingFile需要FileName和FilePattern,但是我不知道FilePattern的作用。我认为它只是被忽略了。这是我的log4j2.xml的一部分
<Property name="pattern">
%-5p [%d{dd.MM.yyyy - HH:mm:ss}] : %m%n %ex
</Property>
<Property name="MainLoggerPath">
C:/logs/MainLogger.log
</Property>
<Property name="FilePattern">
C:/logs/$${date:yyyy-MM}/app-%d{MM- dd-yyyy}-%i.log.gz
</Property>
<RollingFile name="MainAppender" fileName="${MainLoggerPath}"
filePattern="${FilePattern}">
<ThresholdFilter level="ALL" onMatch="ACCEPT" onMismatch="DENY" />
<PatternLayout
pattern="${pattern}" />
<Policies>
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
<DefaultRolloverStrategy max="10" />
</RollingFile>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8141 次 |
| 最近记录: |