|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.appender.OutputStreamManager
public class OutputStreamManager
Manage an OutputStream so that it can be shared by multiple Appenders and will allow appenders to reconfigure without requiring a new stream.
Field Summary |
---|
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
count, LOGGER |
Constructor Summary | |
---|---|
protected |
OutputStreamManager(OutputStream os,
String streamName)
|
Method Summary | |
---|---|
protected void |
close()
|
void |
flush()
Flush any buffers. |
static OutputStreamManager |
getManager(String name,
Object data,
ManagerFactory<OutputStreamManager,Object> factory)
Create a Manager. |
protected OutputStream |
getOutputStream()
|
boolean |
isOpen()
Return the status of the stream. |
void |
releaseSub()
Default hook to write footer during close. |
void |
setFooter(byte[] footer)
Set the footer to write when the stream is closed. |
void |
setHeader(byte[] header)
Set the header to write when the stream is opened. |
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. |
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
getCount, getManager, getName, hasManager, release |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected OutputStreamManager(OutputStream os, String streamName)
Method Detail |
---|
public static OutputStreamManager getManager(String name, Object data, ManagerFactory<OutputStreamManager,Object> factory)
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 setHeader(byte[] header)
header
- The header.public void setFooter(byte[] footer)
footer
- The footer.public void releaseSub()
releaseSub
in class AbstractManager
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.
AppenderRuntimeException
- if an error occurs.protected void write(byte[] bytes)
bytes
- The serialized Log event.
AppenderRuntimeException
- if an error occurs.protected void close()
public void flush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |