Constructor | Description |
---|---|
SharedFileWriter(String filename) |
|
SharedFileWriter(String filename,
boolean append) |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Close the log file.
|
void |
flush() |
Flush this writer and force any buffered data to output.
|
String |
getFilename() |
Get the filename of the log file.
|
Set<LogEntryValue> |
getRequiredLogEntryValues() |
Get all log entry values that are required by this writer.
|
void |
init(Configuration configuration) |
Initialize the writer (open a file for example).
|
boolean |
isAppending() |
Determine whether appending is enabled.
|
void |
write(LogEntry logEntry) |
Write a log entry.
|
public SharedFileWriter(String filename)
filename
- Filename of the log filepublic SharedFileWriter(String filename, boolean append)
filename
- Filename of the log fileappend
- Continuing existing filepublic Set<LogEntryValue> getRequiredLogEntryValues()
Writer
getRequiredLogEntryValues
in interface Writer
public String getFilename()
public boolean isAppending()
true
if appending is enabled, otherwise false
public void init(Configuration configuration) throws IOException
Writer
init
in interface Writer
configuration
- Configuration of loggerIOException
public void write(LogEntry logEntry) throws IOException
Writer
write
in interface Writer
logEntry
- Log entry to outputIOException
public void flush()
Writer
public void close() throws IOException
close
in interface Writer
IOException
- Failed to close the log fileCopyright © 2019. All rights reserved.