org.log5j.writer
Class RollingFileWriter
java.lang.Object
org.log5j.Writer
org.log5j.writer.RollingFileWriter
public final class RollingFileWriter
- extends Writer
RollingFileWriter writes log messages to a file, and rolls the
file either periodically or on the basis of file size.
RollingFileWriter recognises the following configuration
properties;
append: If true, append messages to the end of the file
if it exists already; Over-write any existing file if false. The rules for
setting the value of append are those of the
Boolean.valueOf(String) method.
filename: The name of the file to write to. If filename
is not an absolute path, It will be relative to the runtime directory of the
JVM.
maxsize: The maximum size of the file (in bytes) before
the file should be rolled. This should be an integer value.
period: The time period between file rolls. The format
the period is written in is specified by ISOPeriodFormat.standard()
rolltime: The next time the file should be rolled. The
format the time is written in is specified by
ISODateTimeFormat.basicDateTime(). Use this in conjunction with
period to specify that a file be rolled every hour on the
hour, or at 2:00am every morning.
- Author:
- Bruce Ashton
|
Constructor Summary |
RollingFileWriter(Format format,
java.util.Properties properties)
Create a new RollingFileWriter. |
|
Method Summary |
void |
write(java.lang.String message)
Write a single message to the log. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RollingFileWriter
public RollingFileWriter(Format format,
java.util.Properties properties)
throws java.io.IOException
- Create a new
RollingFileWriter.
- Parameters:
format - the Format object for this
RollingFileWriterproperties - configuration properties for this
RollingFileWriter.
- Throws:
java.io.IOException - if the file cannot be opened for writing
write
public void write(java.lang.String message)
- Description copied from class:
Writer
- Write a single message to the log.
- Specified by:
write in class Writer
- Parameters:
message - the message to write