org.apache.log.output
Class AbstractTarget
java.lang.Object
org.apache.log.output.AbstractTarget
- ErrorAware, LogTarget
public abstract class AbstractTarget
extends java.lang.Object
Abstract target.
void | close() - Shutdown target.
|
protected abstract void | doProcessEvent(LogEvent event) - Process a log event, via formatting and outputting it.
|
protected void | error(String message, Throwable throwable) - Use getErrorHandler().error(...) directly
|
protected ErrorHandler | getErrorHandler() - Helper method to retrieve ErrorHandler for subclasses.
|
protected boolean | isOpen() - Return the open state of the target.
|
protected void | open() - Startup log session.
|
void | processEvent(LogEvent event) - Process a log event, via formatting and outputting it.
|
void | setErrorHandler(ErrorHandler errorHandler) - Provide component with ErrorHandler.
|
AbstractTarget
public AbstractTarget()
AbstractTarget constructor.
AbstractTarget
public AbstractTarget(ErrorHandler errorHandler)
AbstractTarget constructor.
errorHandler
- the error handler
close
public void close()
Shutdown target.
Attempting to write to target after close() will cause errors to be logged.
doProcessEvent
protected abstract void doProcessEvent(LogEvent event)
throws Exception
Process a log event, via formatting and outputting it.
This should be overidden by subclasses.
error
protected final void error(String message,
Throwable throwable)
Use getErrorHandler().error(...) directly
Helper method to write error messages to error handler.
message
- the error messagethrowable
- the exception if any
getErrorHandler
protected final ErrorHandler getErrorHandler()
Helper method to retrieve ErrorHandler for subclasses.
isOpen
protected boolean isOpen()
Return the open state of the target.
- TRUE if the target is open else FALSE
open
protected void open()
Startup log session.