public class PeriodicRotatingFileHandler extends FileHandler
setSuffix(String)
.Modifier and Type | Class and Description |
---|---|
static class |
PeriodicRotatingFileHandler.Period
Possible period values.
|
outputLock
handlers, handlersUpdater
Constructor and Description |
---|
PeriodicRotatingFileHandler()
Construct a new instance with no formatter and no output file.
|
PeriodicRotatingFileHandler(File file,
String suffix)
Construct a new instance with the given output file.
|
PeriodicRotatingFileHandler(File file,
String suffix,
boolean append)
Construct a new instance with the given output file and append setting.
|
PeriodicRotatingFileHandler(String fileName)
Construct a new instance with the given output file.
|
PeriodicRotatingFileHandler(String fileName,
boolean append)
Construct a new instance with the given output file and append setting.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getNextSuffix()
Returns the suffix to be used.
|
TimeZone |
getTimeZone()
Get the configured time zone for this handler.
|
protected void |
preWrite(ExtLogRecord record)
Execute any pre-write policy, such as file rotation.
|
void |
setFile(File file)
Set the output file.
|
void |
setSuffix(String suffix)
Set the suffix string.
|
void |
setTimeZone(TimeZone timeZone)
Set the configured time zone for this handler.
|
getFile, setAppend, setFileName
getEncoding, setEncoding, setOutputStream, setWriter
close, doPublish, flush, safeClose
addHandler, checkAccess, checkAccess, clearHandlers, disableAccess, enableAccess, getHandlers, isAutoFlush, isCloseChildren, isEnabled, protect, publish, publish, removeHandler, setAutoFlush, setCloseChildren, setEnabled, setErrorManager, setFilter, setFormatter, setHandlers, setLevel, unprotect
getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError
public PeriodicRotatingFileHandler()
public PeriodicRotatingFileHandler(String fileName) throws FileNotFoundException
fileName
- the file nameFileNotFoundException
- if the file could not be found on openpublic PeriodicRotatingFileHandler(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 PeriodicRotatingFileHandler(File file, String suffix) throws FileNotFoundException
file
- the filesuffix
- the format suffix to useFileNotFoundException
- if the file could not be found on openpublic PeriodicRotatingFileHandler(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 void setFile(File file) throws FileNotFoundException
FileHandler
setFile
in class FileHandler
file
- the fileFileNotFoundException
- if an error occurs opening the fileprotected void preWrite(ExtLogRecord record)
preWrite
in class WriterHandler
record
- the record about to be loggedpublic void setSuffix(String suffix) throws IllegalArgumentException
SimpleDateFormat
.
The period of the rotation is automatically calculated based on the suffix.suffix
- the suffixIllegalArgumentException
- if the suffix is not validprotected final String getNextSuffix()
public TimeZone getTimeZone()
public void setTimeZone(TimeZone timeZone)
timeZone
- the configured time zoneCopyright © 2017 JBoss by Red Hat. All rights reserved.