LogBack generates strange files: /

I like LogBack , seriously I do!

I configured it so that most of the time it creates log files with the following structure:

 + logs - latestRun.log + rolled - logFile_2012-03-09T03.log - logFile_2012-03-09T04.log - etc... 

The structure above makes me very happy! (Sometimes this is not a problem, but this is another problem)

Sometimes I get files like this:

 + logs - latestRun.log - latestRun.log1998071534195169.tmp - latestRun.log2016071527094180.tmp - etc... + rolled - logFile_2012-03-09T03.log - logFile_2012-03-09T04.log - etc... 

Now those .tmp files are a pain in the neck and I really can't explain why they were created. The problem seems to be more frequent when I add .gz to <fileNamePattern> to compress deployed files.

This is how my appender is configured in my logback.xml file:

 <property name="LOGS_FOLDER" value="logs/" /> <appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOGS_FOLDER}latestRun.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover --> <fileNamePattern>${LOGS_FOLDER}rolled/logFile_%d{yyyy-MM-dd'T'HH}.log.gz</fileNamePattern> <!-- keep 30 days' worth of history --> <maxHistory>30</maxHistory> </rollingPolicy> <encoder> <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> </encoder> </appender> 

Linux Ubuntu Environment

+4
source share
1 answer

Similar to the incarnation of LBCORE-169 . We can only vote and wait ...

+1
source

Source: https://habr.com/ru/post/1400615/


All Articles