public class WriterManager extends AbstractManager
Modifier and Type | Field and Description |
---|---|
protected StringLayout |
layout |
count, LOGGER
Constructor and Description |
---|
WriterManager(Writer writer,
String streamName,
StringLayout layout,
boolean writeHeader) |
Modifier and Type | Method and Description |
---|---|
protected void |
close() |
void |
flush()
Flushes any buffers.
|
static <T> WriterManager |
getManager(String name,
T data,
ManagerFactory<? extends WriterManager,T> factory)
Creates a Manager.
|
protected Writer |
getWriter() |
boolean |
isOpen()
Returns the status of the stream.
|
void |
releaseSub()
Default hook to write footer during close.
|
protected void |
setWriter(Writer writer) |
protected void |
write(String str)
Some output streams synchronize writes while others do not.
|
protected void |
writeFooter()
Writes the footer.
|
getContentFormat, getCount, getName, hasManager, log, logDebug, logError, logWarn, release, updateData
protected final StringLayout layout
public WriterManager(Writer writer, String streamName, StringLayout layout, boolean writeHeader)
public static <T> WriterManager getManager(String name, T data, ManagerFactory<? extends WriterManager,T> factory)
T
- The type of the WriterManager.name
- The name of the stream to manage.data
- The data to pass to the Manager.factory
- The factory to use to create the Manager.protected void close()
public void flush()
protected Writer getWriter()
public boolean isOpen()
public void releaseSub()
releaseSub
in class AbstractManager
protected void setWriter(Writer writer)
protected void write(String str)
bytes
- The serialized Log event.offset
- The offset into the byte array.length
- The number of bytes to write.AppenderLoggingException
- if an error occurs.protected void writeFooter()
Copyright © 1999-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.