logrotate duplicate processing incorrect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logrotate (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
logrotate 3.11.0
A file which matches two different patterns in the logrotate.conf file causes a "duplicate log entry" error. The file is rotated but no other subsequent files are rotated.
This is illogical.
(1) If a duplicate log entry is indeed an error then that file should not be rotated. It is.
(2) Files to be rotated which are not in error should still be rotated. They are not.
(3) [Small but important point:] The message is misleading - what is detected by logrotate is not a duplicate log entry but that a file matches more than one log entry. If no such duplicate +file+ exists the duplicate +log entry+ is not detected.
Suggestions:
(A) A duplicate should prevent processing of that file, but that file only.
(B) A resolution hierarchy be specified so that [optionally - new directive?] which of the various duplicates should be used. Last [or first?] takes precedence.
(C) Error message should be improved. Perhaps "file matches more than one pattern"
Whatever, there is no easy workaround for the problem I describe here. For example: I wish to rotate all of many *.log files according to one rule except for special.log which I wish to rotate according to another. This conf
file has the above described behaviour:
*.log {
<directives>
}
special.log {
<other directives>
}
special.log is rotated, a "duplicate log entry" is reported, other processing stops. Yes, I have tested this, reversed the order, etc etc. If I take out the special.log stanza then the other files are successfully rotated.
description: | updated |