[logback-user] logback rollover within a certain period of time

MOO MIK KI moomikki1988 at gmail.com
Thu Dec 15 08:31:38 CET 2011


Dear sir/madam,

I am a university student trying to create a software related to my
coursework and 1 of the requirements is that the output of logback file
will rollover to new files every 5 minutes. I am unable to find a solution
to this and i tried to use the
periodictimebasedfilenamingandtriggeringpolicy. I cannot get any msg out of
it.
Here is my configuration in the xml when i use
periodictimebasedfilenamingandtriggeringpolicy :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
 <appender name="rsms.rolling"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>d:\\log\\RSMS\\RSMS.txt</file>
 <ImmediateFlush>true</ImmediateFlush>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
 <!-- rollover daily -->
<fileNamePattern>d:\\log\\RSMS\\BK\\RSMS-%d{yyyy-MM-dd_HHmm}.%i.txt</fileNamePattern>
 </rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.PeriodicTimeBasedFileNamingAndTriggeringPolicy">
  <period>600</period>
   </triggeringPolicy>
      <layout class="ch.qos.logback.classic.PatternLayout">
       <Pattern>%d{yyyyMMdd HHmmss.SSS} [%-5level]%msg%n</Pattern>
     </layout>
   </appender>
<logger name="lol" level="debug" additivity="false">
 <appender-ref ref="rsms.rolling" />
</logger>
</configuration>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111215/d0d4318c/attachment.html>


More information about the Logback-user mailing list