LogBack generando archivos extraños: /

Me gusta LogBack, seriously I do!

I configured it in a way that most of the times produces 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 the content does not but this is another issue)

Occasionally, I end up with files like this though:

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

Ahora esos .tmp files are a pain in the neck and I really cannot explain why they are generated. The issue seems to be more frequent when I add the .gz en el objeto <fileNamePattern> for compressing the rolled files.

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

<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>

El ambiente es Linux Ubuntu

preguntado el 09 de marzo de 12 a las 16:03

1 Respuestas

Looks like an incarnation of LBCORE-169 bug. We can only vote and wait...

respondido 09 mar '12, 16:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.