public class OutputStreamManager extends AbstractManager
Modifier and Type | Field and Description |
---|---|
protected Layout<?> |
layout |
count, LOGGER
Modifier | Constructor and Description |
---|---|
protected |
OutputStreamManager(OutputStream os,
String streamName,
Layout<?> layout) |
Modifier and Type | Method and Description |
---|---|
protected void |
close() |
void |
flush()
Flushes any buffers.
|
static <T> OutputStreamManager |
getManager(String name,
T data,
ManagerFactory<? extends OutputStreamManager,T> factory)
Creates a Manager.
|
protected OutputStream |
getOutputStream() |
boolean |
isOpen()
Returns the status of the stream.
|
void |
releaseSub()
Default hook to write footer during close.
|
protected void |
setOutputStream(OutputStream os) |
protected void |
write(byte[] bytes)
Some output streams synchronize writes while others do not.
|
protected void |
write(byte[] bytes,
int offset,
int length)
Some output streams synchronize writes while others do not.
|
protected void |
writeFooter()
Writes the footer.
|
getContentFormat, getCount, getName, hasManager, release
protected OutputStreamManager(OutputStream os, String streamName, Layout<?> layout)
public static <T> OutputStreamManager getManager(String name, T data, ManagerFactory<? extends OutputStreamManager,T> factory)
T
- The type of the OutputStreamManager.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.public void releaseSub()
releaseSub
in class AbstractManager
protected void writeFooter()
public boolean isOpen()
protected OutputStream getOutputStream()
protected void setOutputStream(OutputStream os)
protected void write(byte[] bytes, int offset, int length)
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 write(byte[] bytes)
bytes
- The serialized Log event.AppenderLoggingException
- if an error occurs.protected void close()
public void flush()
Copyright © 1999-2021 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.