Top Description Fields Constructors Methods
org.apache.log.output.io

public Class WriterTarget

extends AbstractOutputTarget
Class Inheritance
Imports
java.io.IOException, .Writer, org.apache.log.format.Formatter, org.apache.log.output.AbstractOutputTarget

This target outputs to a writer.
Author
Peter Donald

Field Summary

Modifier and TypeField and Description
private Writer

Constructor Summary

AccessConstructor and Description
public
WriterTarget(final Writer
the writer
writer
,
final Formatter
the formatter
formatter
)

Construct target with a specific writer and formatter.

Method Summary

Modifier and TypeMethod and Description
public synchronized void
protected synchronized void
setWriter(final Writer
the new writer
writer
)

Set the writer.

protected synchronized void
shutdownWriter()

Shutdown Writer.

protected void
write(final String
the data to output
data
)

Overrides org.apache.log.output.AbstractOutputTarget.write.

Concrete implementation of output that writes out to underlying writer.
Inherited from org.apache.log.output.AbstractOutputTarget:
doProcessEventgetFormatteropen

Field Detail

m_outputback to summary
private Writer m_output

Constructor Detail

WriterTargetback to summary
public WriterTarget(final Writer writer, final Formatter formatter)

Construct target with a specific writer and formatter.

Parameters
writer:Writer

the writer

formatter:Formatter

the formatter

Method Detail

closeback to summary
public synchronized void close()

Overrides org.apache.log.output.AbstractOutputTarget.close.

Implements org.apache.log.util.Closeable.close.

Shutdown target. Attempting to write to target after close() will cause errors to be logged.

setWriterback to summary
protected synchronized void setWriter(final Writer writer)

Set the writer. Close down writer and write tail if appropriate.

Parameters
writer:Writer

the new writer

shutdownWriterback to summary
protected synchronized void shutdownWriter()

Shutdown Writer.

writeback to summary
protected void write(final String data)

Overrides org.apache.log.output.AbstractOutputTarget.write.

Concrete implementation of output that writes out to underlying writer.

Parameters
data:String

the data to output