Issue Type: Bug Bug
Affects Versions: 1.0.13
Assignee: Logback dev list
Components: logback-core
Created: 15/May/14 8:43 AM
Description:

I am using com.mchange.v2.c3p0.ComboPooledDataSource in my application (scala).

Here is sample code used by my application, which causes this.

...
val source = new ComboPooledDataSource
...

Normally messages from ComboPooledDataSource logs to console. But if console and appender file (see xml below) are same, then RollingFileAppender does not rotate log file. Instead it keeps appending to the same file.

e.g.
So for configuration below, we expect new file each minute.
Expected files after 2 runs in 2 mins are,
1) /test/logs/application.log and 2) /test/logs/application.2014-05-14_23_34.log

Instead both run gets logged in /test/logs/application.log.

I have tested this on intellij and also using wrapper script.

If stdout is redirected to any log other than /test/logs/application.log, then it works as expected.

Logback Configuration -
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>/test/logs/application.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>/test/logs/application.%d

{yyyy-MM-dd_HH_mm}

.log</fileNamePattern>
<maxHistory>20</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d

{HH:mm:ss.SSS}

[%X

{akkaSource}

] [%thread] %-5level %logger

{36}

- %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="FILE" />
</root>
</configuration>

Environment:

Java version 1.7, on OSX and CentOS

Project: logback
Labels: TimeBasedRollingPolicy rollingPolicy
Priority: Major Major
Reporter: kaustubh sathe
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