public class FileRotationHandler extends Handler
Constructor and Description |
---|
FileRotationHandler()
Create handler.
|
FileRotationHandler(String directory,
String prefix,
Formatter formatter)
Create handler.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close handler.
|
void |
flush()
Flush handler.
|
int |
getFileCountPerArchive()
Number of log files to keep before per archive file.
|
String |
getNewFileHeader()
Header written to newly created log files after rotation.
|
int |
getRetainArchiveCount()
Number of log file archives to keep before deleting them.
|
int |
getRetainFileCount()
Number of log files to keep before archiving them.
|
void |
publish(LogRecord record)
Publish log record.
|
void |
setFileCountPerArchive(int fileCountPerArchive)
Set number of log files to keep before per archive file.
|
void |
setNewFileHeader(String newFileHeader)
Header written to newly created log files after rotation.
|
void |
setRetainArchiveCount(int retainArchiveCount)
Set number of log file archives to keep before deleting them.
|
void |
setRetainFileCount(int count)
Set number of log files to keep before archiving them.
|
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
public FileRotationHandler() throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public FileRotationHandler(String directory, String prefix, Formatter formatter) throws IOException, ClassNotFoundException
directory
- Directory to create log files in. If null uses LogManager
configuration property. If not defined uses working directory.prefix
- Log file prefix. If null uses LogManager configuration
property. If not defined uses "TimApi-".formatter
- Formatter to use. If null uses LogManager configuration
property. If not defined uses SimpleLineLogFormatter.IOException
- Log directory can not be created.ClassNotFoundException
- Formatter class can not be found or instantiated.public int getRetainFileCount()
public void setRetainFileCount(int count)
public int getFileCountPerArchive()
public void setFileCountPerArchive(int fileCountPerArchive)
public int getRetainArchiveCount()
public void setRetainArchiveCount(int retainArchiveCount)
public String getNewFileHeader()
public void setNewFileHeader(String newFileHeader)