Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.1.1
-
Windows 7
Description
I have configured a RollingFileAppender with a TimeBasedRollingPolicy and a SizeAndTimeBasedFNATP. The logging works, the zip files are created, but .tmp als files with logging information are created in the working directory. These are of the size, i configured. I do not know why they are there and why they were created in the first place.
My log configuration is as follows:
LoggerContext context = (LoggerContext)LoggerFactory.getILoggerFactory();
context.reset();
PatternLayoutEncoder encoder = new PatternLayoutEncoder();
encoder.setPattern("%-5level %-20([%thread]) %-36alias
- %msg%n");
encoder.setContext(context);
encoder.start();
RollingFileAppender<ILoggingEvent> rfa = new RollingFileAppender<>();
rfa.setFile(".log");
rfa.setEncoder(encoder);
RollingPolicyBase rolling = new TimeBasedRollingPolicy<>();
SizeAndTimeBasedFNATP<ILoggingEvent> sizeandtime = new SizeAndTimeBasedFNATP<>();
sizeandtime.setMaxFileSize("10MB");
sizeandtime.setTimeBasedRollingPolicy((TimeBasedRollingPolicy) rolling);
((TimeBasedRollingPolicy) rolling).setTimeBasedFileNamingAndTriggeringPolicy(sizeandtime);
((TimeBasedRollingPolicy) rolling).setFileNamePattern("%d
.%i.log.zip");
((TimeBasedRollingPolicy) rolling).setMaxHistory(30));
rolling.setContext(encoder.getContext());rolling.setParent(rfa);
rolling.start();
rfa.setRollingPolicy(rolling);
Attachments
Issue Links
- is duplicated by
-
LOGBACK-173 Log Rotation/Gzip process leaving .tmp files behind
- Resolved
-
LOGBACK-920 temporary file not removed during rotation with compressed files
- Closed
- relates to (out)
-
LOGBACK-1137 Detect collisions in time date format in FileNamePattern
- Closed