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
{36}
- %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
{yyyy-MM-dd}
.%i.log.zip");
((TimeBasedRollingPolicy) rolling).setMaxHistory(30));
rolling.setContext(encoder.getContext());rolling.setParent(rfa);
rolling.start();
rfa.setRollingPolicy(rolling);
|