Details
Description
The RollingFileAppender dosn't append to the current log file after restart of Service at Windows.
At UNIX Systems it works as expected.
Our log4j2 Configuration:
<?xml version="1.0" encoding="UTF-8"?> <Configuration status="WARN" packages="de.uplanet.lucy.server.portalserver.messages" shutdownHook="disable"> <Properties> <Property name="de.uplanet.lucy.logPath">log</Property> </Properties> <Appenders> <!-- File appender configuration (daily rotation) --> <RollingFile name="DailyFile" fileName="${sys:de.uplanet.lucy.logPath}/portal.log" filePattern="${sys:de.uplanet.lucy.logPath}/portal.%d{yyyy-MM-dd}.log"> <PatternLayout> <pattern>%-5p %d{ISO8601}{UTC}Z - %c[%t]%n %m%n</pattern> </PatternLayout> <Policies> <TimeBasedTriggeringPolicy interval="1"/> </Policies> <ThresholdFilter level="DEBUG" onMatch="ACCEPT" onMismatch="DENY"/> </RollingFile> <Loggers> <!-- Set root logger level --> <Root level="WARN"> <AppenderRef ref="DailyFile"/> </Root> <Logger name="de.uplanet" level="info" additivity="false"> <AppenderRef ref="DailyFile"/> </Logger> </Loggers> </Configuration>
If you have a new Installation it works as expected, after a few days we have this behavior:
Example at 16.04.2019:
After an restart of the service, the content portal.log will be copied in a file with that name portal.15-12-2018.log. the 15th december 2018 is the creation date of the log folder where the logs are saved.
And after that the old content in portal.log will be deleted.
New log content will be logged in the empty portal.log