public final class RollingFileWriter extends AbstractFormatPatternWriter
policies
and the output can be buffered for improving performance. The path to the log file can contain one or more
patterns that will be resolved at runtime.Constructor and Description |
---|
RollingFileWriter() |
RollingFileWriter(Map<String,String> properties) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the writer.
|
void |
flush()
Outputs buffered log entries immediately.
|
void |
write(LogEntry logEntry)
Outputs a given log entry.
|
createByteArrayWriter, getCharset, getFileName, getRequiredLogEntryValues, render
public RollingFileWriter() throws FileNotFoundException
FileNotFoundException
- Log file does not exist or cannot be opened for any other reasonIllegalArgumentException
- A property has an invalid value or is missing in configurationpublic RollingFileWriter(Map<String,String> properties) throws FileNotFoundException
properties
- Configuration for writerFileNotFoundException
- Log file does not exist or cannot be opened for any other reasonIllegalArgumentException
- A property has an invalid value or is missing in configurationpublic void write(LogEntry logEntry) throws IOException
Writer
logEntry
- Log entry to outputIOException
public void flush() throws IOException
Writer
IOException
public void close() throws IOException, InterruptedException
Writer
IOException
InterruptedException
Copyright © 2020. All rights reserved.