Constructor | Description |
---|---|
FileWriter(String filename) |
|
FileWriter(String filename,
boolean buffered) |
|
FileWriter(String filename,
boolean buffered,
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.
|
boolean |
isBuffered() |
Determine whether buffered writing is enabled.
|
void |
write(LogEntry logEntry) |
Write a log entry.
|
public FileWriter(String filename)
filename
- Filename of the log filepublic FileWriter(String filename, boolean buffered)
filename
- Filename of the log filebuffered
- Buffered writingpublic FileWriter(String filename, boolean buffered, boolean append)
filename
- Filename of the log filebuffered
- Buffered writingappend
- Continuing existing filepublic Set<LogEntryValue> getRequiredLogEntryValues()
Writer
getRequiredLogEntryValues
in interface Writer
public String getFilename()
public boolean isBuffered()
true
if buffered writing is enabled, otherwise false
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() throws IOException
Writer
flush
in interface Writer
IOException
public void close() throws IOException
close
in interface Writer
IOException
- Failed to close the log fileCopyright © 2019. All rights reserved.