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

I want to store only the last 500MB log data everyday and gzip it .

    XMLWordPrintable

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.1.8
    • logback-core
    • Ubuntu 14.04 

      logback.xml

       

    Description

      Hi help to complete the task .

      I need only the last 500MB generated logs data each day and compress it and have backup of 10days and should delete the older file after 10th day 

      Even though i use rolling file appender its zipping the first 500MB data and creating a tmp file if the app generates extra 500mb data same day i need to store only 500mb data that to app lastestly generated logs .

      He is my configuration : 

       

      <appender name="FILE-ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <file>test.log</file>

      <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
      <fileNamePattern>test.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
      <!-- each archived file, size max 500MB -->
      <maxFileSize>500MB</maxFileSize>
      <!-- total size of all archive files, if total size > 5GB, it will delete old archived file -->
      <totalSizeCap>5GB</totalSizeCap>
      <!-- 10 days to keep -->
      <maxHistory>10</maxHistory>
      </rollingPolicy>

      <encoder>
      <pattern>%d{yyyy-MM-dd HH:mm:ss:SSS}*%m%n<</pattern>
      </encoder>
      </appender>

       

       

      Attachments

        Activity

          People

            logback-dev Logback dev list
            vamsivutukuri Vamsi Vutukuri
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: