Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1401

Logback creating .tmp file

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None
    •  

       

    Description

      Below is the logback.xml , which is generating weird log files e.g. 

      im.log2323744883452020.tmp.

      I was expecting to write im-2018-05-23-0.log.zip , im-2018-05-23-1.log.zip, im-2018-05-23-2.log.zip

       

      logback version is 1.1.0

      I have read many other issues where logback is generating .tmp files, but none of them matched my problem. Can you help me with that?

       

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration scan="true" scanPeriod="60 seconds">
      <!-- To access logs during development, right click on your local server and browse deployment location. Go one level up
       to view the logs folder. -->
       <property name="LOG_PATH" value="${catalina.base}/logs/" />
      <!-- Log pattern for development. Different patterns can be subsequently defined for different environment needs -->
       <property name="LOG_PATTERN" value="%d [%X{username}] [%level] [%logger{0}:%line] - %msg%n" />
       <property name="LOG_MAX_HISTORY" value="1" /> <!-- in days -->
       <property name="LOG_MAX_FILE_SIZE" value="500KB" />
       <property name="LOG_FILE" value="${LOG_PATH}/im.log" />
       <property name="LOG_FILE_ARCHIVE" value="${LOG_PATH}/im-%d{yyyy-MM-dd}-%i.log.zip" />
      <property name="LOG_SLOW_METHOD_PATTERN" value="${LOG_PATTERN}" />
       <property name="LOG_SLOW_METHOD_MAX_HISTORY" value="${LOG_MAX_HISTORY}" /> <!-- in days -->
       <property name="LOG_SLOW_METHOD_MAX_FILE_SIZE" value="${LOG_MAX_FILE_SIZE}" />
       <property name="LOG_SLOW_METHOD_FILE" value="${LOG_PATH}/im-slow-methods.log" />
       <property name="LOG_SLOW_METHOD_FILE_ARCHIVE" value="${LOG_PATH}/im-slow-methods.%d{yyyy-MM-dd}-%i.log.zip" />
      
       <!-- STDOUT logging for development -->
       <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
       <encoder>
       <charset>utf-8</charset>
       <pattern>${LOG_PATTERN}</pattern>
       </encoder>
       </appender>
      <!-- FILE logging -->
       <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
       <File>${LOG_FILE}</File>
      <encoder>
       <charset>utf-8</charset>
       <pattern>${LOG_PATTERN}</pattern>
       </encoder>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
       <fileNamePattern>${LOG_FILE_ARCHIVE}</fileNamePattern>
       <maxHistory>${LOG_MAX_HISTORY}</maxHistory>
       <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
       <maxFileSize>${LOG_MAX_FILE_SIZE}</maxFileSize>
       </timeBasedFileNamingAndTriggeringPolicy>
       </rollingPolicy>
       </appender>
       
      
       <appender name="SLOW_METHOD" class="ch.qos.logback.core.FileAppender">
       <File>${LOG_SLOW_METHOD_FILE}</File>
      <encoder>
       <charset>utf-8</charset>
       <pattern>${LOG_SLOW_METHOD_PATTERN}</pattern>
       </encoder>
       <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
       <fileNamePattern>${LOG_SLOW_METHOD_FILE_ARCHIVE}</fileNamePattern>
       <maxHistory>${LOG_SLOW_METHOD_MAX_HISTORY}</maxHistory>
       <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
       <maxFileSize>${LOG_SLOW_METHOD_MAX_FILE_SIZE}</maxFileSize>
       </timeBasedFileNamingAndTriggeringPolicy>
       </rollingPolicy>
       </appender>
      <appender name="MM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
       <File>${catalina.base}/logs/dhap-metrics-manager.log</File>
       <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
       <!-- rollover daily -->
       <fileNamePattern>${catalina.base}/logs/dhap-metrics-manager_%d{yyyy-MM-dd}.%i.log
       </fileNamePattern>
       <timeBasedFileNamingAndTriggeringPolicy
       class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
       <!-- or whenever the file size reaches 10MB -->
       <maxFileSize>10MB</maxFileSize>
       </timeBasedFileNamingAndTriggeringPolicy>
      <!-- keep 30 days' worth of history -->
       <maxHistory>30</maxHistory>
       </rollingPolicy>
       <encoder>
       <charset>utf-8</charset>
       <pattern>%msg%n</pattern>
       </encoder>
       </appender>
      <!-- <root level="INFO"> -->
       <!-- <appender-ref ref="CONSOLE" /> -->
       <!-- </root> -->
      <root level="INFO">
       <appender-ref ref="FILE" />
       </root>
      <!--app-idet logger -->
       <!-- DEBUG logger should be updated to INFO in production deployment to reduce log load in server -->
       <logger name="com.lifetech.ga.app" level="INFO">
      </logger>
      <logger name="metricsManagerLogger" level="INFO">
       <appender-ref ref="MM_FILE" />
       </logger>
      <!--dhap security jars logger -->
       <logger name="com.lifetech.apps.security" level="WARN">
       </logger>
      <logger name="com.lifetech.ga.core.aspect.MethodProfiler" level="INFO" additivity="false">
       <appender-ref ref="CONSOLE" />
       <appender-ref ref="SLOW_METHOD" />
       </logger>
      </configuration>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            mahtab.alam Mahtab Alam
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: