public abstract class AbstractOutputTarget extends AbstractTarget
| Modifier and Type | Field and Description |
|---|---|
private Formatter |
m_formatter
Formatter for target.
|
| Constructor and Description |
|---|
AbstractOutputTarget()
Parameterless constructor.
|
AbstractOutputTarget(Formatter formatter)
Creation of a new abstract output target instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shutdown target.
|
protected void |
doProcessEvent(LogEvent event)
Process a log event.
|
private java.lang.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 java.lang.String |
getHead()
Helper method to retrieve head for log session.
|
private java.lang.String |
getTail()
Helper method to retrieve tail for log session.
|
protected void |
open()
Startup log session.
|
protected void |
write(java.lang.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.
|
getErrorHandler, isOpen, processEvent, setErrorHandlerprivate Formatter m_formatter
public AbstractOutputTarget()
public AbstractOutputTarget(Formatter formatter)
formatter - the formatter to applyprotected Formatter getFormatter()
protected void write(java.lang.String data)
data - the data to be outputprotected void doProcessEvent(LogEvent event)
doProcessEvent in class AbstractTargetevent - the event to processprotected void open()
open in class AbstractTargetpublic void close()
close in interface Closeableclose in class AbstractTargetprivate java.lang.String format(LogEvent event)
event - the LogEventprivate void writeHead()
private void writeTail()
private java.lang.String getHead()
private java.lang.String getTail()