admin管理员组文章数量:1346676
Logback is creating .tmp
files during log rotation, and they are not being deleted even after the retention period.
These .tmp
files can be generated for various reasons, but the goal is to ensure they are automatically removed after log rotation or at a later stage.
Using logback 1.2.10 version.
Below is the .tmp file and logback configuration.
-rw-rw----+ 1 root root 121 Mar 1 00:00 /var/log/cli/cli_2025-02-28.0.log372862483201017.tmp
`<appender name="CliAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/cli/cli.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>/var/log/cli/cli_%d{yyyy-MM-dd}.%i.log.gz
</fileNamePattern>
<maxFileSize>50MB</maxFileSize>
<!-- keep 30 days' worth of history -->
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<charset>UTF-8</charset>
<pattern>%d{"yyyy-MM-dd'T'HH:mm:ss,SSSXXX"} [%thread] %-5level %msg%n
</pattern>
</encoder>
</appender> `
本文标签: loggingLogback Fails to Delete tmp Files After Log RotationStack Overflow
版权声明:本文标题:logging - Logback Fails to Delete `.tmp` Files After Log Rotation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743828285a2546050.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论