public class RotatingFileTarget extends FileTarget
Constructor and Description |
---|
RotatingFileTarget(boolean append,
Formatter formatter,
RotateStrategy rotateStrategy,
FileStrategy fileStrategy)
Construct RotatingFileTarget object.
|
RotatingFileTarget(Formatter formatter,
RotateStrategy rotateStrategy,
FileStrategy fileStrategy)
Construct RotatingFileTarget object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
rotate()
Rotates the file.
|
protected void |
write(String data)
Output the log message, and check if rotation is needed.
|
getFile, openFile, setFile
close, setOutputStream, shutdownStream
doProcessEvent, getFormatter, open
getErrorHandler, isOpen, processEvent, setErrorHandler
public RotatingFileTarget(Formatter formatter, RotateStrategy rotateStrategy, FileStrategy fileStrategy) throws IOException
formatter
- Formatter to be usedrotateStrategy
- RotateStrategy to be usedfileStrategy
- FileStrategy to be usedIOException
- if a file access or write related error occurspublic RotatingFileTarget(boolean append, Formatter formatter, RotateStrategy rotateStrategy, FileStrategy fileStrategy) throws IOException
append
- true if file is to be appended to, false otherwiseformatter
- Formatter to be usedrotateStrategy
- RotateStrategy to be usedfileStrategy
- FileStrategy to be usedIOException
- if a file access or write related error occursprotected void rotate() throws IOException
IOException
- if a file access or write related error occursprotected void write(String data)
write
in class StreamTarget
data
- the date to write to the targetCopyright © 1997–2022. All rights reserved.