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

CyclicBufferFileAppender

    XMLWordPrintable

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • logback-core
    • None

    Description

      We mostly use "FileAppender" and/or RollingFileAppender.

      We have a debug level on certain logger just to be sure we'll be able to analyse what's goign wrong in case of an error.

      This cause huge amount of logs and slow down our application.

      It would be nice to combine CyclicBufferTracker (like in SMTPAppender) and FileAppender to be able to get only the n last lines before and error event occurs.

      I create a POC and end up to the conclusion that 50 % performance improvement (with the last 1000 lines).

      I would like to send you the POC but I can't upload here.

      Sample conf :
      <configuration>
      <appender name="FILE" class="fr.opensagres.CyclicBufferFileAppender">
      <file>testFile.log</file>
      <append>true</append>

      <encoder>
      <pattern>%-4relative [%thread] %-5level %logger

      {35}

      - %msg%n</pattern>
      </encoder>
      <cyclicBufferTracker class="ch.qos.logback.core.spi.CyclicBufferTrackerImpl">

      <bufferSize>1000</bufferSize>
      </cyclicBufferTracker>
      </appender>
      <root level="DEBUG">
      <appender-ref ref="FILE" />
      </root>
      </configuration>

      regards

      Attachments

        Activity

          People

            logback-dev Logback dev list
            pascalleclercq Pascal Leclercq
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: