Writer
AbstractFormatPatternWriter
, JsonWriter
public abstract class AbstractFileBasedWriter extends AbstractWriter
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractFileBasedWriter(java.util.Map<java.lang.String,java.lang.String> properties) |
Modifier and Type | Method | Description |
---|---|---|
protected static ByteArrayWriter |
createByteArrayWriter(java.lang.String fileName,
boolean append,
boolean buffered,
boolean threadSafe,
boolean shared,
java.nio.charset.Charset charset) |
Creates a
ByteArrayWriter for a file. |
protected java.nio.charset.Charset |
getCharset() |
Extracts the charset from configuration.
|
protected static byte[] |
getCharsetHeader(java.nio.charset.Charset charset) |
Generate the header for the passed charset (for example BOM for UTF-16).
|
protected java.lang.String |
getFileName() |
Extracts the log file name from configuration.
|
getBooleanValue, getStringValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, flush, getRequiredLogEntryValues, write
protected AbstractFileBasedWriter(java.util.Map<java.lang.String,java.lang.String> properties)
properties
- Configuration for writerprotected java.lang.String getFileName()
java.lang.IllegalArgumentException
- Log file is not defined in configurationprotected java.nio.charset.Charset getCharset()
protected static ByteArrayWriter createByteArrayWriter(java.lang.String fileName, boolean append, boolean buffered, boolean threadSafe, boolean shared, java.nio.charset.Charset charset) throws java.io.IOException
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 processescharset
- Charset used by the writerjava.io.IOException
- Log file cannot be opened for write accessprotected static byte[] getCharsetHeader(java.nio.charset.Charset charset)
charset
- Charset for which the header should be generated forCopyright © 2022. All rights reserved.