org.apache.log.output.io.rotate
Class RotatingFileTarget
java.lang.Object
|
+--org.apache.log.output.AbstractTarget
|
+--org.apache.log.output.AbstractOutputTarget
|
+--org.apache.log.output.io.StreamTarget
|
+--org.apache.log.output.io.FileTarget
|
+--org.apache.log.output.io.rotate.RotatingFileTarget
- All Implemented Interfaces:
- ErrorAware, LogTarget
- public class RotatingFileTarget
- extends FileTarget
This is a basic Output log target that writes to rotating files.
- Author:
- Peter Donald, Stephen McConnell, Bernhard Huber
|
Method Summary |
protected void |
rotate()
Rotates the file. |
protected void |
write(String data)
Output the log message, and check if rotation is needed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RotatingFileTarget
public RotatingFileTarget(Formatter formatter,
RotateStrategy rotateStrategy,
FileStrategy fileStrategy)
throws IOException
- Construct RotatingFileTarget object.
- Parameters:
formatter - Formatter to be usedrotateStrategy - RotateStrategy to be usedfileStrategy - FileStrategy to be used
- Throws:
IOException - if a file access or write related error occurs
RotatingFileTarget
public RotatingFileTarget(boolean append,
Formatter formatter,
RotateStrategy rotateStrategy,
FileStrategy fileStrategy)
throws IOException
- Construct RotatingFileTarget object.
- Parameters:
append - true if file is to be appended to, false otherwiseformatter - Formatter to be usedrotateStrategy - RotateStrategy to be usedfileStrategy - FileStrategy to be used
- Throws:
IOException - if a file access or write related error occurs
rotate
protected void rotate()
throws IOException
- Rotates the file.
- Throws:
IOException - if a file access or write related error occurs
write
protected void write(String data)
- Output the log message, and check if rotation is needed.
- Overrides:
write in class StreamTarget
- Parameters:
data - the date to write to the target
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.