org.apache.log.output

Class DefaultOutputLogTarget

Implemented Interfaces:
ErrorAware, LogTarget
Known Direct Subclasses:
FileOutputLogTarget, ServletOutputLogTarget

public class DefaultOutputLogTarget
extends WriterTarget

This is a basic Output log target that writes to a stream. The format is specified via a string.
Author:
Peter Donald

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

DefaultOutputLogTarget()
Default Constructor.
DefaultOutputLogTarget(OutputStream output)
Constructor that takes a stream arguement.
DefaultOutputLogTarget(Writer writer)
Constructor that takes a writer parameter.
DefaultOutputLogTarget(Writer writer, Formatter formatter)
Construct target with a specific writer and formatter.
DefaultOutputLogTarget(Formatter formatter)
Creation of a new abstract output target instance.

Method Summary

protected void
initPattern()
Deprecated. This is no longer the recomended way to set formatter.
void
setFormat(String format)
Deprecated. This method is unsafe as it assumes formatter is PatternFormatter and accesses a protected attribute.

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

DefaultOutputLogTarget

public DefaultOutputLogTarget()
Default Constructor.

DefaultOutputLogTarget

public DefaultOutputLogTarget(OutputStream output)
Constructor that takes a stream arguement.
Parameters:
output - the output stream

DefaultOutputLogTarget

public DefaultOutputLogTarget(Writer writer)
Constructor that takes a writer parameter.
Parameters:
writer - the Writer

DefaultOutputLogTarget

public DefaultOutputLogTarget(Writer writer,
                              Formatter formatter)
Construct target with a specific writer and formatter.
Parameters:
writer - the writer
formatter - the formatter

DefaultOutputLogTarget

public DefaultOutputLogTarget(Formatter formatter)
Creation of a new abstract output target instance.
Parameters:
formatter - the formatter to apply

Method Details

initPattern

protected void initPattern()

Deprecated. This is no longer the recomended way to set formatter. It is recomended that it be passed into constructor.

Initialize the default pattern.

setFormat

public void setFormat(String format)

Deprecated. This method is unsafe as it assumes formatter is PatternFormatter and accesses a protected attribute. Instead of calling this method It is recomended that a fully configured formatter is passed into constructor.

Set the format string for this target.
Parameters:
format - the format string