[logback-dev] [JIRA] (LOGBACK-1425) logback implementation leaves .tmp file while rolling

QOS.CH (JIRA) noreply-jira at qos.ch
Mon Sep 24 14:42:00 CEST 2018


Mukesh created LOGBACK-1425:
-------------------------------

             Summary: logback implementation leaves .tmp file while rolling
                 Key: LOGBACK-1425
                 URL: https://jira.qos.ch/browse/LOGBACK-1425
             Project: logback
          Issue Type: Bug
         Environment: Production
            Reporter: Mukesh
            Assignee: Logback dev list


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>



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the logback-dev mailing list