|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.output.AbstractTarget
org.apache.log.output.AbstractOutputTarget
public abstract class AbstractOutputTarget
Abstract output target. Any new output target that is writing to a single connected resource should extend this class directly or indirectly.
Field Summary | |
---|---|
private Formatter |
m_formatter
Formatter for target. |
Constructor Summary | |
---|---|
AbstractOutputTarget()
Parameterless constructor. |
|
AbstractOutputTarget(Formatter formatter)
Creation of a new abstract output target instance. |
Method Summary | |
---|---|
void |
close()
Shutdown target. |
protected void |
doProcessEvent(LogEvent event)
Process a log event. |
private String |
format(LogEvent event)
Helper method to format an event into a string, using the formatter if available. |
protected Formatter |
getFormatter()
Returns the Formatter. |
private String |
getHead()
Helper method to retrieve head for log session. |
private String |
getTail()
Helper method to retrieve tail for log session. |
protected void |
open()
Startup log session. |
protected void |
write(String data)
Abstract method to write data. |
private void |
writeHead()
Helper method to write out log head. |
private void |
writeTail()
Helper method to write out log tail. |
Methods inherited from class org.apache.log.output.AbstractTarget |
---|
getErrorHandler, isOpen, processEvent, setErrorHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Formatter m_formatter
Constructor Detail |
---|
public AbstractOutputTarget()
public AbstractOutputTarget(Formatter formatter)
formatter
- the formatter to applyMethod Detail |
---|
protected Formatter getFormatter()
protected void write(String data)
data
- the data to be outputprotected void doProcessEvent(LogEvent event)
doProcessEvent
in class AbstractTarget
event
- the event to processprotected void open()
open
in class AbstractTarget
public void close()
close
in interface Closeable
close
in class AbstractTarget
private String format(LogEvent event)
event
- the LogEvent
private void writeHead()
private void writeTail()
private String getHead()
private String getTail()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |