public abstract class AbstractFormatPatternWriter extends Object implements Writer
format
.Constructor and Description |
---|
AbstractFormatPatternWriter(Map<String,String> properties) |
Modifier and Type | Method and Description |
---|---|
protected static ByteArrayWriter |
createByteArrayWriter(String fileName,
boolean append,
boolean buffered,
boolean threadSafe,
boolean shared)
Creates a
ByteArrayWriter for a file. |
protected static Charset |
getCharset(Map<String,String> properties)
Extracts the charset from configuration.
|
protected static String |
getFileName(Map<String,String> properties)
Extracts the log file name from configuration.
|
Collection<LogEntryValue> |
getRequiredLogEntryValues()
Gets all log entry values that are required for rendering a log entry by the defined format pattern.
|
protected String |
render(LogEntry logEntry)
Renders a log entry as string.
|
public Collection<LogEntryValue> getRequiredLogEntryValues()
getRequiredLogEntryValues
in interface Writer
protected static String getFileName(Map<String,String> properties)
properties
- Configuration for writerIllegalArgumentException
- Log file is not defined in configurationprotected static Charset getCharset(Map<String,String> properties)
properties
- Configuration for writerprotected static ByteArrayWriter createByteArrayWriter(String fileName, boolean append, boolean buffered, boolean threadSafe, boolean shared) throws FileNotFoundException
ByteArrayWriter
for a file.fileName
- Name of file to open for writingappend
- An already existing file should be continuedbuffered
- Output should be bufferedthreadSafe
- Created writer must be thread-safeshared
- Output file is shared with other processesFileNotFoundException
- File does not exist or cannot be opened for any other reasonCopyright © 2020. All rights reserved.