Modifier and Type | Field and Description |
---|---|
static int |
DAY
Day
|
static int |
HOUR
Hour
|
static int |
MINUTE
Minute
|
static int |
MONTH
Month
|
DEFAULT_MAX_SIZE, out
Constructor and Description |
---|
LogRotationWriter(java.lang.String file_name,
LogLevel verbose_level,
long max_size,
int num_rotations,
int time_scale,
int time_value)
Creates a new LogRotationWriter.
|
LogRotationWriter(java.lang.String file_name,
LogLevel verbose_level,
long max_size,
int num_rotations,
int time_scale,
int time_value,
boolean append)
Creates a new LogRotationWriter.
|
Modifier and Type | Method and Description |
---|---|
LogRotationWriter |
rotate()
Rotates logs.
|
void |
write(java.lang.String str)
Writes a string onto the inner writer.
|
close, getLoggingLevel, log, log, log, reset, setLoggingLevel, setTimestamp
public static final int MONTH
public static final int DAY
public static final int HOUR
public static final int MINUTE
public LogRotationWriter(java.lang.String file_name, LogLevel verbose_level, long max_size, int num_rotations, int time_scale, int time_value)
file_name
- the file where log messages are written toverbose_level
- the verbose levelmax_size
- the maximum size for the log, that is the maximum number of characters that can be writtennum_rotations
- the number of log file rotations (value 0 means no rotation)time_scale
- the time scale (MONTH, DAY, HOUR, or MINUTE)time_value
- the time value when log files are rotated (actual time = time_scale * time_value)public LogRotationWriter(java.lang.String file_name, LogLevel verbose_level, long max_size, int num_rotations, int time_scale, int time_value, boolean append)
file_name
- the file where log messages are written toverbose_level
- the verbose levelmax_size
- the maximum size for the log, that is the maximum number of characters that can be writtennum_rotations
- the number of log file rotations (value 0 means no rotation)time_scale
- the time scale (MONTH, DAY, HOUR, or MINUTE)time_value
- the time value when log files are rotated (actual time = time_scale * time_value)append
- if true, it opens the existing log file in 'append' mode, without rewritting the previously saved contentpublic LogRotationWriter rotate()