Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-270

Set the logback to rollover new files every x minutes

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • logback-core
    • None

    Description

      Dear dev,

      I tried one of the solutions here .periodictimebasedfilenamingandtrigerringpolicy but its not working. I tried to include it in my system which the requirements requires me to create new log file every 5 minutes. Please help me with my university project. thank you.

      xml :

      <?xml version="1.0" encoding="UTF-8" ?>
      <configuration scan="true" scanPeriod="60 seconds">
      <appender name="my_appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <File>F:/Logs/Server.log</File>
      <encoder>
      <Pattern>Server[%d

      {ISO8601}

      ][%p] - %m%n</Pattern>
      </encoder>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <FileNamePattern>F:/Logs/Server-%d

      {yyyy-MM-dd_HH-mm-ss}

      .log</FileNamePattern>
      </rollingPolicy>
      <triggeringPolicy class="ch.qos.logback.core.rolling.PeriodicTimeBasedFileNamingAndTriggeringPolicy">
      <period>600</period>
      </triggeringPolicy>
      </appender>
      <logger name="com.mypackage.application" level="debug" additivity="false">
      <appender-ref ref="my_appender" />
      </logger>
      </configuration>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            moomikki moo mik ki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: