Red Hat Bugzilla – Bug 1260036
PeriodicSizeRotatingFileHandler's maxBackupIndex is not working as expected
Last modified: 2015-10-20 02:23:48 EDT
Title: Types of Log Handlers
Describe the issue:
As per bz-1244292, there is an issue with maxBackupIndex of PeriodicSizeRotatingFileHandler and looking at the bugzilla comment it looks like this issue will not be fixed in upcoming realeses. So it will be good if we mention this bugzilla in product documentation.
Suggestions for improvement:
Available from JBoss EAP 6.4. This is a combination of the Periodic and Size handlers and supports their combined attributes.
Once the current log file reaches the specified size, or the specified time period has passed, the file is renamed and the handler continues to write to a newly created log file with the original name.
There is an known issue with PeriodicSizeRotatingFileHandler the maxBackupIndex is not working as expected. This issue is captured in bu-1244292.
The new note "Note that if a file is rotated with a date format suffix, it will not be purged using the max-backup-index option." is OK.
However, the paragraph above now seems contradictory to the new note. It says that the logs rotated based on the suffix are deleted when maxBackupIndex is reached.
(1) The first paragraph saying "The maximum number of rotated logs that are kept. When this number is reached, the oldest log is reused. Default: 1." is OK. I would suggest though to explicitly mention the size rotation there. Try to reformulate the "number of rotated logs" to something which suggests "logs rotated based on the file size only".
(2) Remove the paragraph above the new note:
"If the suffix attribute is used, the suffix of rotated log files is included in the rotation algorithm. When the log file is rotated, the oldest file whose name starts with name+suffix is deleted, the remaining rotated log files have their numeric suffix incremented and the newly rotated log file is given the numeric suffix 1."
(3) Keep the new note as is to make it clear that logs rotated based on the date suffix are not deleted.
Verified in revision Revision 6.4.0-40
Released in EAP 6.4 docs async release.