|
||||||||||
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
Manages an OutputStream so that it can be shared by multiple Appenders and will allow appenders to reconfigure without requiring a new stream.
Field Summary | |
---|---|
protected Layout<?> |
layout
|
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
count, LOGGER |
Constructor Summary | |
---|---|
protected |
OutputStreamManager(OutputStream os,
String streamName,
Layout<?> layout)
|
Method Summary | ||
---|---|---|
protected void |
close()
|
|
void |
flush()
Flushes any buffers. |
|
static
|
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. |
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager |
---|
getContentFormat, getCount, getName, hasManager, release |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Layout<?> layout
Constructor Detail |
---|
protected OutputStreamManager(OutputStream os, String streamName, Layout<?> layout)
Method Detail |
---|
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2015 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.