Daan created Bug LOGBACK-1064
Issue Type: Bug Bug
Affects Versions: 1.1.2
Assignee: Logback dev list
Components: logback-classic
Created: 15/Apr/15 7:57 AM
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>
Environment:

SUSE Linux Enterprise Server 11 (x86_64)
WebLogic Server version: 10.3.6.0
JDK 1.6.0_32

Project: logback
Labels: filename
Priority: Major Major
Reporter: Daan
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira