org.apache.log.output.io

Class WriterTarget

public class WriterTarget extends AbstractOutputTarget

This target outputs to a writer.

Author: Peter Donald

Field Summary
Writerm_output
Constructor Summary
WriterTarget(Writer writer, Formatter formatter)
Construct target with a specific writer and formatter.
Method Summary
voidclose()
Shutdown target.
protected voidsetWriter(Writer writer)
Set the writer.
protected voidshutdownWriter()
Shutdown Writer.
protected voidwrite(String data)
Concrete implementation of output that writes out to underlying writer.

Field Detail

m_output

private Writer m_output

Constructor Detail

WriterTarget

public WriterTarget(Writer writer, Formatter formatter)
Construct target with a specific writer and formatter.

Parameters: writer the writer formatter the formatter

Method Detail

close

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

setWriter

protected void setWriter(Writer writer)
Set the writer. Close down writer and write tail if appropriate.

Parameters: writer the new writer

shutdownWriter

protected void shutdownWriter()
Shutdown Writer.

write

protected void write(String data)
Concrete implementation of output that writes out to underlying writer.

Parameters: data the data to output