ErrorAware
, LogTarget
, Closeable
public class RotatingFileTarget extends FileTarget
Modifier and Type | Field | Description |
---|---|---|
private boolean |
m_append |
|
private FileStrategy |
m_fileStrategy |
|
private RotateStrategy |
m_rotateStrategy |
Constructor | 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 | Description |
---|---|---|
protected void |
rotate() |
Rotates the file.
|
protected void |
write(java.lang.String data) |
Output the log message, and check if rotation is needed.
|
doProcessEvent, getFormatter, open
getErrorHandler, isOpen, processEvent, setErrorHandler
getFile, openFile, setFile
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, setOutputStream, shutdownStream
private boolean m_append
private RotateStrategy m_rotateStrategy
private FileStrategy m_fileStrategy
public RotatingFileTarget(Formatter formatter, RotateStrategy rotateStrategy, FileStrategy fileStrategy) throws java.io.IOException
formatter
- Formatter to be usedrotateStrategy
- RotateStrategy to be usedfileStrategy
- FileStrategy to be usedjava.io.IOException
- if a file access or write related error occurspublic RotatingFileTarget(boolean append, Formatter formatter, RotateStrategy rotateStrategy, FileStrategy fileStrategy) throws java.io.IOException
append
- true if file is to be appended to, false otherwiseformatter
- Formatter to be usedrotateStrategy
- RotateStrategy to be usedfileStrategy
- FileStrategy to be usedjava.io.IOException
- if a file access or write related error occursprotected void rotate() throws java.io.IOException
java.io.IOException
- if a file access or write related error occursprotected void write(java.lang.String data)
write
in class StreamTarget
data
- the date to write to the targetCopyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.