public class PeriodicSizeRotatingFileHandler extends PeriodicRotatingFileHandler
PeriodicRotatingFileHandler.setSuffix(String).
The size interval is determined by the value passed in the setRotateSize(long).PeriodicRotatingFileHandler.PeriodoutputLockhandlers, handlersUpdater| Constructor and Description |
|---|
PeriodicSizeRotatingFileHandler()
Default constructor.
|
PeriodicSizeRotatingFileHandler(File file,
String suffix)
Construct a new instance with the given output file.
|
PeriodicSizeRotatingFileHandler(File file,
String suffix,
boolean append)
Construct a new instance with the given output file and append setting.
|
PeriodicSizeRotatingFileHandler(File file,
String suffix,
long rotateSize,
int maxBackupIndex)
Construct a new instance with the given output file.
|
PeriodicSizeRotatingFileHandler(File file,
String suffix,
long rotateSize,
int maxBackupIndex,
boolean append)
Construct a new instance with the given output file.
|
PeriodicSizeRotatingFileHandler(String fileName)
Construct a new instance with the given output file.
|
PeriodicSizeRotatingFileHandler(String fileName,
boolean append)
Construct a new instance with the given output file and append setting.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
preWrite(ExtLogRecord record)
Execute any pre-write policy, such as file rotation.
|
void |
setFile(File file)
Set the output file.
|
void |
setMaxBackupIndex(int maxBackupIndex)
Set the maximum backup index (the number of log files to keep around).
|
void |
setOutputStream(OutputStream outputStream)
Set the output stream to write to.
|
void |
setRotateSize(long rotateSize)
Set the rotation size, in bytes.
|
getNextSuffix, getTimeZone, setSuffix, setTimeZonegetFile, setAppend, setFileNamegetEncoding, setEncoding, setWriterclose, doPublish, flush, safeCloseaddHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotectgetErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportErrorpublic PeriodicSizeRotatingFileHandler()
public PeriodicSizeRotatingFileHandler(String fileName) throws FileNotFoundException
fileName - the file nameFileNotFoundException - if the file could not be found on openpublic PeriodicSizeRotatingFileHandler(String fileName, boolean append) throws FileNotFoundException
fileName - the file nameappend - true to append, false to overwriteFileNotFoundException - if the file could not be found on openpublic PeriodicSizeRotatingFileHandler(File file, String suffix) throws FileNotFoundException
file - the filesuffix - the format suffix to useFileNotFoundException - if the file could not be found on openpublic PeriodicSizeRotatingFileHandler(File file, String suffix, boolean append) throws FileNotFoundException
file - the filesuffix - the format suffix to useappend - true to append, false to overwriteFileNotFoundException - if the file could not be found on openpublic PeriodicSizeRotatingFileHandler(File file, String suffix, long rotateSize, int maxBackupIndex) throws FileNotFoundException
file - the filesuffix - the format suffix to userotateSize - the size the file should rotate atmaxBackupIndex - the maximum number of files to backupFileNotFoundException - if the file could not be found on openpublic PeriodicSizeRotatingFileHandler(File file, String suffix, long rotateSize, int maxBackupIndex, boolean append) throws FileNotFoundException
file - the filesuffix - the format suffix to userotateSize - the size the file should rotate atmaxBackupIndex - the maximum number of files to backupappend - true to append, false to overwriteFileNotFoundException - if the file could not be found on openpublic void setOutputStream(OutputStream outputStream)
OutputStreamHandlersetOutputStream in class OutputStreamHandleroutputStream - the new output stream or null for nonepublic void setFile(File file) throws FileNotFoundException
FileHandlersetFile in class PeriodicRotatingFileHandlerfile - the fileFileNotFoundException - if an error occurs opening the filepublic void setRotateSize(long rotateSize)
rotateSize - the number of bytes before the log is rotatedpublic void setMaxBackupIndex(int maxBackupIndex)
maxBackupIndex - the maximum backup indexprotected void preWrite(ExtLogRecord record)
PeriodicRotatingFileHandlerpreWrite in class PeriodicRotatingFileHandlerrecord - the record about to be loggedCopyright © 2012 JBoss by Red Hat. All Rights Reserved.