我的logback配置文件中有以下appender:
<configuration>
<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator>
<key>classname</key>
<defaultValue>unknown</defaultValue>
</discriminator>
<sift>
<appender name="FILE-${classname}" class="ch.qos.logback.core.FileAppender">
<file>target/logs/${classname}.log</file>
<append>false</append>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>[%thread] %level %logger{35} - %msg%n</pattern>
</layout>
</appender>
</sift>
</appender>
<root level="DEBUG">
<appender-ref ref="SIFT" />
</root>
</configuration>
如何配置回退以执行以下操作:
谢谢
答案 0 :(得分:1)
请检查此链接。这将为“在启动时始终生成新文件并删除现有文件”
提供解决方案http://veerasundar.com/blog/2009/08/how-to-create-a-new-log-file-for-each-time-the-application-runs/
How do I make log4j clear a log at startup?
“文件超过50 mb时清除文件”的解决方案