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

wrong log filename

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.2
    • logback-classic
    • SUSE Linux Enterprise Server 11 (x86_64)
      WebLogic Server version: 10.3.6.0
      JDK 1.6.0_32

    Description

      Expect filename: "status-expydev.log", but there is "status-expydev.log51278328382594821.tmp"

       
      -rw-r----- 1 dev_expy_web app   81401  4月 10 00:00 status-expydev.log.2015-04-09.gz
      -rw-r----- 1 dev_expy_web app  190061  4月 14 10:01 status-expydev.log.2015-04-10.gz
      -rw-r----- 1 dev_expy_web app  240220  4月 15 00:00 status-expydev.log.2015-04-14.gz
      -rw-r----- 1 dev_expy_web app 2149718  4月 15 13:42 status-expydev.log51278328382594821.tmp
      

      On another server, there are two files end with "tmp"

       
      -rw-r----- 1 expy_biz app    123  4月 15 06:00 status-expyweb1.log1638971483444302.tmp
      -rw-r----- 1 expy_biz app 561421  4月 15 13:49 status-expyweb1.log1639533568312638.tmp
      -rw-r----- 1 expy_biz app  52134  4月 15 00:00 status-expyweb1.log.2015-04-14.gz
      

      Why?

      pom.xml
      		<dependency>
      			<groupId>org.slf4j</groupId>
      			<artifactId>slf4j-api</artifactId>
      			<version>1.7.7</version>
      		</dependency>
      		<dependency>
      			<groupId>ch.qos.logback</groupId>
      			<artifactId>logback-classic</artifactId>
      			<version>1.1.2</version>
      		</dependency>
      
      logback.xml
      <configuration>
      
      	<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      		<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder 
      			by default -->
      		<encoder>
      			<pattern>%d{HH:mm:ss} [%thread] \(%file:%line\) - %msg%n</pattern>
      		</encoder>
      	</appender>
      
      	<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
      		<!-- in the absence of the class attribute, it is assumed that the desired 
      			discriminator type is ch.qos.logback.classic.sift.MDCBasedDiscriminator -->
      		<sift>
      			<appender name="FILE-${hostname}"
      				class="ch.qos.logback.core.rolling.RollingFileAppender">
      				<file>/${USER}/log/status/status-${HOSTNAME}.log</file>
      				<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      					<!-- daily rollover -->
      					<fileNamePattern>/${USER}/log/status/status-${HOSTNAME}.log.%d{yyyy-MM-dd}.gz
      					</fileNamePattern>
      
      					<!-- keep 30 days' worth of history -->
      					<maxHistory>30</maxHistory>
      				</rollingPolicy>
      
      				<encoder>
      					<pattern>%d{HH:mm:ss} [%thread] - %msg%n</pattern>
      				</encoder>
      			</appender>
      		</sift>
      	</appender>
      
      	<root level="info">
      		<appender-ref ref="SIFT" />
      	</root>
      </configuration>
      

      Attachments

        Activity

          People

            logback-dev Logback dev list
            hda Daan
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: