Package org.apache.log.output.io
Class WriterTarget
java.lang.Object
org.apache.log.output.AbstractTarget
org.apache.log.output.AbstractOutputTarget
org.apache.log.output.io.WriterTarget
- All Implemented Interfaces:
ErrorAware,LogTarget,Closeable
This target outputs to a writer.
- Author:
- Peter Donald
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWriterTarget(Writer writer, Formatter formatter) Construct target with a specific writer and formatter. -
Method Summary
Methods inherited from class org.apache.log.output.AbstractOutputTarget
doProcessEvent, getFormatter, openMethods inherited from class org.apache.log.output.AbstractTarget
getErrorHandler, isOpen, processEvent, setErrorHandler
-
Field Details
-
m_output
-
-
Constructor Details
-
WriterTarget
Construct target with a specific writer and formatter.- Parameters:
writer- the writerformatter- the formatter
-
-
Method Details
-
setWriter
Set the writer. Close down writer and write tail if appropriate.- Parameters:
writer- the new writer
-
write
Concrete implementation of output that writes out to underlying writer.- Overrides:
writein classAbstractOutputTarget- Parameters:
data- the data to output
-
close
public void close()Shutdown target. Attempting to write to target after close() will cause errors to be logged.- Specified by:
closein interfaceCloseable- Overrides:
closein classAbstractOutputTarget
-
shutdownWriter
protected void shutdownWriter()Shutdown Writer.
-