[logback-dev] [JIRA] (LOGBACK-1297) Logback fails to roll once the file count exceeds 1000
QOS.CH (JIRA)
noreply-jira at qos.ch
Wed May 10 19:34:00 CEST 2017
Jason Flores created LOGBACK-1297:
-------------------------------------
Summary: Logback fails to roll once the file count exceeds 1000
Key: LOGBACK-1297
URL: https://jira.qos.ch/browse/LOGBACK-1297
Project: logback
Issue Type: Bug
Affects Versions: 1.2.3
Environment: Windows Server 2012 R2
Processor: Intel Xeon CPU E5-2676 v3 @ 2.40GHz
Memory: 4Gb
Reporter: Jason Flores
Assignee: Logback dev list
Attachments: logqueue-rolling-0.png, logqueue-rolling-1.png
Using the configuration below, copied from Chapter 4: Appenders, of the Logback Manual I've modified the maxFileSize, maxHistory, and totalSizeCap values.
{{<?xml version="1.0" encoding="UTF-8"?>}}
{{<!-- -Dlogback.configurationFile=/path/to/config.xml -->}}
{{<configuration scan='true' scanPeriod='30 seconds'>}}{{<appender name='FILE' class='ch.qos.logback.core.rolling.RollingFileAppender'>}}
{{ <file>3mlogqueueforwardservice.log</file>}}
{{ <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">}}
{{ <!-- rollover daily -->}}
{{ <fileNamePattern>3mlogqueueforwardservice-%d\{yyyy-MM-dd}.%i.log</fileNamePattern>}}
{{ <!-- each file should be at most 5MB, keeping 15 days worth of history, but at most 200MB -->}}
{{ <maxFileSize>20MB</maxFileSize>}}
{{ <!-- the maximum number of archive files to keep, asynchronously deleting older files -->}}
{{ <maxHistory>2</maxHistory>}}
{{ <!-- the total size of all archive files -->}}
{{ <totalSizeCap>100MB</totalSizeCap>}}
{{ </rollingPolicy>}}
{{ <encoder>}}
{{ <charset>UTF-8</charset>}}
{{ <pattern>%date %level [%thread] %logger\{10} [%file:%line] %msg%n</pattern>}}
{{ </encoder>}}
{{ </appender>}}{{<logger name="com.mmm.his" level='info' additivity='false'>}}
{{ <appender-ref ref='FILE' />}}
{{ </logger>}}
{{ <root level='warn'>}}
{{ <appender-ref ref='FILE' />}}
{{ </root>}}
{{</configuration>}}
For this configuration I should only ever have 5 files of ~20mb. The rolling functionality appears to work fine when the index %i is < 1000, after which the totalSizeCap fails and files are endlessly written at ~20mb until all the available space on the machine is consumed. The log files contain no indication of Logback failing...
The two images attached show the log file rolling successfully and then failing to remove files as the index increases > 1000. I've replicated this several times, but only by watching the logs grow and inspecting the contents of the log; our application collects and logs rather quickly.
Is there an interim solution? We're stucking restarting and deleting each time the problem occurs.
--
This message was sent by Atlassian JIRA
(v7.3.1#73012)
More information about the logback-dev
mailing list