[slf4j-user] Log Rotation not proper
Harsimranjit singh Kler
simran4u2 at gmail.com
Thu Jun 23 09:21:35 CEST 2011
Using
SLF4j 1.6.1,logback0.9.24 and following configurations for time and size
based logging and archiving.
<configuration scan="true" scanPeriod="30 seconds">
<property name="LOGS_HOME" value="${MY_DIRECTORY}/logs/app_logs"/>
<appender name="ROLLING"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOGS_HOME}/applicationLogs.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${LOGS_HOME}/archive/applicationLogs-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<!-- <pattern>%-4relative [%thread] %X{USER} %X{REQUEST_ID} %-5level
%logger{35} %d{yyyy-MM-dd HH:mm:ss.SSSS}- %msg%n</pattern> -->
<pattern> %d{yyyy-MM-dd HH:mm:ss.SSSS} %-4relative [%thread] %-5level
%logger{35} - %msg%n</pattern>
</encoder>
</appender>
<root level="Info">
<appender-ref ref="ROLLING" />
</root>
</configuration>
Normally this configuration work fine..it creates log file write into it and
archive based on time or size
.But sometime application start logging directly inside archive
folder((LOGS_HOME}/archive/applicationLogs)) and nothing updated in regular
path file ${LOGS_HOME}/applicationLogs.log.this behaviour is happen
sometime.
Not able find any solution expecting good solution?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/slf4j-user/attachments/20110623/a7657fda/attachment.html>
More information about the slf4j-user
mailing list