org.apache.log.output
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 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.
|
getErrorHandler, isOpen, processEvent, setErrorHandler
private Formatter m_formatter
public AbstractOutputTarget()
public AbstractOutputTarget(Formatter formatter)
formatter
- the formatter to applyprotected 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 LogEventprivate void writeHead()
private void writeTail()
private String getHead()
private String getTail()
Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.