
Hi, I have configured log appenders to separate logs based on functionality. It looks as below: Appender: <appender name="MOBILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${application.home}/logs/mobile.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover with compression --> <fileNamePattern>${application.home}/logs/mobile-log-%d{dd-MM-yyyy}.gz</fileNamePattern> <!-- keep 1 week worth of history --> <maxHistory>7</maxHistory> </rollingPolicy> <encoder> <pattern>%date{dd-MM-yyyy HH:mm:ss} %message%n</pattern> <!-- this quadruples logging throughput --> <immediateFlush>false</immediateFlush> </encoder> </appender> Logger: <logger name="mobile" level="DEBUG" additivity="false"> <appender-ref ref="MOBILE_APPENDER" /> </logger> Code: Logger.of("mobile").debug("log statement"); Same configuration works well for other appenders and loggers for different log files. In the case of mobile log file, it gets split into multiple tmp files as below mobile.log1069573507939492.tmp mobile.log1156778511668518.tmp mobile.log1420697709142498.tmp mobile.log1503633156746801.tmp mobile.log1674487680335483.tmp mobile.log1761638721293414.tmp mobile.log1932597676801911.tmp Because of this, it does not get compressed at every midnight as per log rolling policy. Any idea why it happens? Regards, Suraj

Hi Suraj, Which version of logback are you using? More recent versions of logback detect collisions between multiple appenders writing to the same file and alerts the user. Collision between appenders is often the cause of .tmp files. -- Ceki On 5/13/2016 11:21, Suraj Mundada wrote:
Hi,
I have configured log appenders to separate logs based on functionality. It looks as below:
Appender:
| <appender name="MOBILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${application.home}/logs/mobile.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover with compression -->
<fileNamePattern>${application.home}/logs/mobile-log-%d{dd-MM-yyyy}.gz</fileNamePattern> <!-- keep 1 week worth of history --> <maxHistory>7</maxHistory> </rollingPolicy> <encoder> <pattern>%date{dd-MM-yyyy HH:mm:ss} %message%n</pattern> <!-- this quadruples logging throughput --> <immediateFlush>false</immediateFlush> </encoder> </appender> |
Logger:
| <logger name="mobile" level="DEBUG" additivity="false"> <appender-ref ref="MOBILE_APPENDER" /> </logger>
|
Code:
| Logger.of("mobile").debug("log statement"); |
Same configuration works well for other appenders and loggers for different log files. In the case of mobile log file, it gets split into multiple tmp files as below
| mobile.log1069573507939492.tmp mobile.log1156778511668518.tmp mobile.log1420697709142498.tmp mobile.log1503633156746801.tmp mobile.log1674487680335483.tmp mobile.log1761638721293414.tmp mobile.log1932597676801911.tmp |
Because of this, it does not get compressed at every midnight as per log rolling policy.
Any idea why it happens?
Regards, Suraj

Hi Ceki, I can not figure out version of logback used by play application. However, there are following jars of logback in my \.ivy2\cache\ch.qos.logback\logback-core\jars folder logback-core-1.1.1 logback-core-1.1.3 logback-core-1.1.4 Regards, Suraj On Fri, May 13, 2016 at 2:51 PM, Suraj Mundada <surajmundada@gmail.com> wrote:
Hi,
I have configured log appenders to separate logs based on functionality. It looks as below:
Appender:
<appender name="MOBILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${application.home}/logs/mobile.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover with compression -->
<fileNamePattern>${application.home}/logs/mobile-log-%d{dd-MM-yyyy}.gz</fileNamePattern> <!-- keep 1 week worth of history --> <maxHistory>7</maxHistory> </rollingPolicy> <encoder> <pattern>%date{dd-MM-yyyy HH:mm:ss} %message%n</pattern> <!-- this quadruples logging throughput --> <immediateFlush>false</immediateFlush> </encoder> </appender>
Logger:
<logger name="mobile" level="DEBUG" additivity="false"> <appender-ref ref="MOBILE_APPENDER" /> </logger>
Code:
Logger.of("mobile").debug("log statement");
Same configuration works well for other appenders and loggers for different log files. In the case of mobile log file, it gets split into multiple tmp files as below
mobile.log1069573507939492.tmp mobile.log1156778511668518.tmp mobile.log1420697709142498.tmp mobile.log1503633156746801.tmp mobile.log1674487680335483.tmp mobile.log1761638721293414.tmp mobile.log1932597676801911.tmp
Because of this, it does not get compressed at every midnight as per log rolling policy.
Any idea why it happens?
Regards, Suraj

Do you have a copt of the full configuration file being used? On 5/13/2016 15:23, Suraj Mundada wrote:
Hi Ceki,
I can not figure out version of logback used by play application.
However, there are following jars of logback in my \.ivy2\cache\ch.qos.logback\logback-core\jars folder
logback-core-1.1.1 logback-core-1.1.3 logback-core-1.1.4
Regards, Suraj
On Fri, May 13, 2016 at 2:51 PM, Suraj Mundada <surajmundada@gmail.com <mailto:surajmundada@gmail.com>> wrote:
Hi,
I have configured log appenders to separate logs based on functionality. It looks as below:
Appender:
| <appender name="MOBILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${application.home}/logs/mobile.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover with compression -->
<fileNamePattern>${application.home}/logs/mobile-log-%d{dd-MM-yyyy}.gz</fileNamePattern> <!-- keep 1 week worth of history --> <maxHistory>7</maxHistory> </rollingPolicy> <encoder> <pattern>%date{dd-MM-yyyy HH:mm:ss} %message%n</pattern> <!-- this quadruples logging throughput --> <immediateFlush>false</immediateFlush> </encoder> </appender> |
Logger:
| <logger name="mobile" level="DEBUG" additivity="false"> <appender-ref ref="MOBILE_APPENDER" /> </logger>
|
Code:
| Logger.of("mobile").debug("log statement"); |
Same configuration works well for other appenders and loggers for different log files. In the case of mobile log file, it gets split into multiple tmp files as below
| mobile.log1069573507939492.tmp mobile.log1156778511668518.tmp mobile.log1420697709142498.tmp mobile.log1503633156746801.tmp mobile.log1674487680335483.tmp mobile.log1761638721293414.tmp mobile.log1932597676801911.tmp |
Because of this, it does not get compressed at every midnight as per log rolling policy.
Any idea why it happens?
Regards, Suraj
_______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Hi Ceki, Please find attached the config files. Regards, Suraj On Fri, May 13, 2016 at 6:53 PM, Suraj Mundada <surajmundada@gmail.com> wrote:
Hi Ceki,
I can not figure out version of logback used by play application.
However, there are following jars of logback in my \.ivy2\cache\ch.qos.logback\logback-core\jars folder
logback-core-1.1.1 logback-core-1.1.3 logback-core-1.1.4
Regards, Suraj
On Fri, May 13, 2016 at 2:51 PM, Suraj Mundada <surajmundada@gmail.com> wrote:
Hi,
I have configured log appenders to separate logs based on functionality. It looks as below:
Appender:
<appender name="MOBILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${application.home}/logs/mobile.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover with compression -->
<fileNamePattern>${application.home}/logs/mobile-log-%d{dd-MM-yyyy}.gz</fileNamePattern> <!-- keep 1 week worth of history --> <maxHistory>7</maxHistory> </rollingPolicy> <encoder> <pattern>%date{dd-MM-yyyy HH:mm:ss} %message%n</pattern> <!-- this quadruples logging throughput --> <immediateFlush>false</immediateFlush> </encoder> </appender>
Logger:
<logger name="mobile" level="DEBUG" additivity="false"> <appender-ref ref="MOBILE_APPENDER" /> </logger>
Code:
Logger.of("mobile").debug("log statement");
Same configuration works well for other appenders and loggers for different log files. In the case of mobile log file, it gets split into multiple tmp files as below
mobile.log1069573507939492.tmp mobile.log1156778511668518.tmp mobile.log1420697709142498.tmp mobile.log1503633156746801.tmp mobile.log1674487680335483.tmp mobile.log1761638721293414.tmp mobile.log1932597676801911.tmp
Because of this, it does not get compressed at every midnight as per log rolling policy.
Any idea why it happens?
Regards, Suraj

Any idea? On Mon, May 16, 2016 at 2:55 PM, Suraj Mundada <surajmundada@gmail.com> wrote:
Hi Ceki,
Please find attached the config files.
Regards, Suraj
On Fri, May 13, 2016 at 6:53 PM, Suraj Mundada <surajmundada@gmail.com> wrote:
Hi Ceki,
I can not figure out version of logback used by play application.
However, there are following jars of logback in my \.ivy2\cache\ch.qos.logback\logback-core\jars folder
logback-core-1.1.1 logback-core-1.1.3 logback-core-1.1.4
Regards, Suraj
On Fri, May 13, 2016 at 2:51 PM, Suraj Mundada <surajmundada@gmail.com> wrote:
Hi,
I have configured log appenders to separate logs based on functionality. It looks as below:
Appender:
<appender name="MOBILE_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${application.home}/logs/mobile.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- daily rollover with compression -->
<fileNamePattern>${application.home}/logs/mobile-log-%d{dd-MM-yyyy}.gz</fileNamePattern> <!-- keep 1 week worth of history --> <maxHistory>7</maxHistory> </rollingPolicy> <encoder> <pattern>%date{dd-MM-yyyy HH:mm:ss} %message%n</pattern> <!-- this quadruples logging throughput --> <immediateFlush>false</immediateFlush> </encoder> </appender>
Logger:
<logger name="mobile" level="DEBUG" additivity="false"> <appender-ref ref="MOBILE_APPENDER" /> </logger>
Code:
Logger.of("mobile").debug("log statement");
Same configuration works well for other appenders and loggers for different log files. In the case of mobile log file, it gets split into multiple tmp files as below
mobile.log1069573507939492.tmp mobile.log1156778511668518.tmp mobile.log1420697709142498.tmp mobile.log1503633156746801.tmp mobile.log1674487680335483.tmp mobile.log1761638721293414.tmp mobile.log1932597676801911.tmp
Because of this, it does not get compressed at every midnight as per log rolling policy.
Any idea why it happens?
Regards, Suraj
participants (2)
-
Ceki Gulcu
-
Suraj Mundada