Policy
DailyPolicy
, HourlyPolicy
, MonthlyPolicy
, WeeklyPolicy
, YearlyPolicy
public abstract class AbstractTimeBasedPolicy extends Object implements Policy
Constructor | Description |
---|---|
AbstractTimeBasedPolicy(Calendar calendar,
int field) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
check(File logFile) |
Determine whether a log file can be continued.
|
boolean |
check(String logEntry) |
Determine whether a log entry can be written into the current log file.
|
void |
init(Configuration configuration) |
Initialize the policy.
|
protected static void |
normalize(Calendar calendar,
int field) |
Make sure that the time is in future.
|
void |
reset() |
The log file was rolled and reset the policy.
|
public AbstractTimeBasedPolicy(Calendar calendar, int field)
calendar
- Time for next rolloverfield
- Field (e.g. Calendar.HOUR_OF_DAY
) to increase after a rolloverpublic void init(Configuration configuration)
Policy
public final boolean check(File logFile)
Policy
public final boolean check(String logEntry)
Policy
public final void reset()
Policy
protected static void normalize(Calendar calendar, int field)
calendar
- Calendar to normalizefield
- Field (e.g. Calendar.HOUR_OF_DAY
) to increaseCopyright © 2019. All rights reserved.