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

logback implementation leaves .tmp file while rolling

    XMLWordPrintable

Details

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

    Description

      While rolling the file name we are getting .tmp files along with the zipped files. My implementation of logback is as below

       

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration scan="true" scanPeriod="30 seconds" debug="true">

          <!-- Send debug messages to System.out -->
          <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
              <!-- By default, encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
              <encoder>
                  <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n
                  </pattern>
              </encoder>
          </appender>

          <appender name="FILE"
              class="ch.qos.logback.core.rolling.RollingFileAppender">
              <file>/usr/local/apache-tomcat-7.0.55/logs/mylog.log
              </file>
              <!-- file>/home/tomcat/temp/GanasevaComm.log </file -->
              <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                  <fileNamePattern>/usr/local/apache-tomcat-7.0.55/logs/mylog_%d{yyyyMMddHHmmss}.%i.log.gz
                  </fileNamePattern>
                  <!-- fileNamePattern>/home/tomcat/temp/GanasevaComm_%d{yyyy-MM-dd}.%i.log.gz
                      </fileNamePattern -->
                  <timeBasedFileNamingAndTriggeringPolicy
                      class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                      <maxFileSize>20MB</maxFileSize>
                  </timeBasedFileNamingAndTriggeringPolicy>
                  <maxHistory>2</maxHistory>
              </rollingPolicy>

              <encoder>
                  <charset>UTF-8</charset>
                  <pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n
                  </pattern>
              </encoder>
          </appender>

          <appender name="GANASEVAFILE"
              class="ch.qos.logback.core.rolling.RollingFileAppender">
              <file>/usr/local/apache-tomcat-7.0.55/logs/AbcComm/abcComm.log
              </file>
              <!-- file>/home/tomcat/temp/GanasevaComm.log </file -->
              <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
                  <fileNamePattern>/usr/local/apache-tomcat-7.0.55/logs/AbcComm/abcComm_%d{yyyy-MM-dd}.%i.log.gz
                  </fileNamePattern>
                  <!-- fileNamePattern>/home/tomcat/temp/GanasevaComm_%d{yyyy-MM-dd}.%i.log.gz
                      </fileNamePattern -->
                  <timeBasedFileNamingAndTriggeringPolicy
                      class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
                      <maxFileSize>20MB</maxFileSize>
                  </timeBasedFileNamingAndTriggeringPolicy>
                  <maxHistory>2</maxHistory>
              </rollingPolicy>

              <encoder>
                  <charset>UTF-8</charset>
                  <pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n
                  </pattern>
              </encoder>
          </appender>
          
          <logger name="org.hibernate.type" level="ERROR" />
          <logger name="org.hibernate.SQL" level="ERROR" />
          <logger name="org.hibernate" level="ERROR" />

          <logger name="org.springframework.transaction" level="ERROR" />
          <logger name="org.springframework.orm" level="ERROR" />
          <logger name="org.springframework" level="ERROR" />
          
          
          <logger name="com.scl.ganaseva.db.communicator" level="DEBUG">
              <appender-ref ref="GANASEVAFILE" />
          </logger>

          <logger name="com.rbl.framework.sms" level="DEBUG">
              <appender-ref ref="FILE" />
          </logger>

          <!-- By default, the level of the root level is set to DEBUG -->
          <root level="DEBUG">
              <appender-ref ref="FILE" />
          </root>
      </configuration>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            mukesh Mukesh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: