org.apache.log.output.io
Class StreamTarget
- ErrorAware, LogTarget
public class StreamTarget
A basic target that writes to an OutputStream.
StreamTarget(OutputStream outputStream, Formatter formatter)- Constructor that writes to a stream and uses a particular formatter.
|
void | close()- Shutdown target.
|
protected void | setOutputStream(OutputStream outputStream)- Set the output stream.
|
protected void | shutdownStream()- Shutdown output stream.
|
protected void | write(String data)- Abstract method that will output event.
|
StreamTarget
public StreamTarget(OutputStream outputStream,
Formatter formatter) Constructor that writes to a stream and uses a particular formatter.
outputStream - the OutputStream to write toformatter - the Formatter to use
close
public void close()
Shutdown target.
Attempting to write to target after close() will cause errors to be logged.
- close in interface AbstractOutputTarget
setOutputStream
protected void setOutputStream(OutputStream outputStream)
Set the output stream.
Close down old stream and write tail if appropriate.
outputStream - the new OutputStream
shutdownStream
protected void shutdownStream()
Shutdown output stream.
write
protected void write(String data)
Abstract method that will output event.
- write in interface AbstractOutputTarget
data - the data to be output