Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.2.3
Description
In RollingCalendar method periodBarriersCrossed, when periods are computed for TOP_OF_HOUR periodicity, unnecessary (and invalid) type cast is performed:
case TOP_OF_HOUR: return (int) diff / MILLIS_IN_ONE_HOUR;
in case diff > MAX_INT, return from method is wrong.
example:
<fileNamePattern>logs/%d{yyyy/MM/dd,aux}/eps_%d{yyyyMMdd-HH}h.%i.log.zip</fileNamePattern>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
After i start application, method TimeBasedArchiverRemover.clean(Date now) is in some point called. Then, computation of period elapsed since last clean is called with parameters:
periodsElapsed = this.rc.periodBarriersCrossed(nowInMillis, nowInMillis + 2764800000L)
where nowInMillis = 1507034734848 (date = Tue Oct 03 14:45:34 CEST 2017)
In method, diff is computed (diff = 2761200000). This value > MAX_INT, so expression
return (int) diff / MILLIS_IN_ONE_HOUR = -426
so no clean up is performed
Attachments
Issue Links
- is duplicated by
-
LOGBACK-1579 Hourly rolling policy not working
- Open