org.apache.log.output

Class ServletOutputLogTarget

Implemented Interfaces:
ErrorAware, LogTarget

public class ServletOutputLogTarget
extends DefaultOutputLogTarget

Generic logging interface. Implementations are based on the strategy pattern.
Author:
Tommy Santoso

Field Summary

Fields inherited from class org.apache.log.output.io.WriterTarget

m_output

Fields inherited from class org.apache.log.output.AbstractOutputTarget

m_formatter

Constructor Summary

ServletOutputLogTarget(ServletContext context)
Constructor.

Method Summary

void
close()
Shutdown target.
protected void
write(String message)
Logs message to servlet context log file

Methods inherited from class org.apache.log.output.DefaultOutputLogTarget

initPattern, setFormat

Methods inherited from class org.apache.log.output.io.WriterTarget

close, setWriter, shutdownWriter, write

Methods inherited from class org.apache.log.output.AbstractOutputTarget

close, doProcessEvent, getFormatter, open, output, setFormatter, write

Methods inherited from class org.apache.log.output.AbstractTarget

close, doProcessEvent, error, getErrorHandler, isOpen, open, processEvent, setErrorHandler

Constructor Details

ServletOutputLogTarget

public ServletOutputLogTarget(ServletContext context)
Constructor.
Parameters:
context - ServletContext to use for logging.

Method Details

close

public void close()
Shutdown target. Attempting to write to target after close() will cause errors to be logged.
Overrides:
close in interface WriterTarget

write

protected void write(String message)
Logs message to servlet context log file
Overrides:
write in interface WriterTarget
Parameters:
message - message to log to servlet context log file.