org.apache.log.output.io
Class StreamTarget
- Closeable, ErrorAware, LogTarget
public class StreamTarget
A basic target that writes to an OutputStream.
private String | m_encoding - The encoding to use when creating byte array for string, may be null.
|
private OutputStream | m_outputStream - OutputStream we are writing to.
|
StreamTarget(OutputStream outputStream, Formatter formatter) - Constructor that writes to a stream and uses a particular formatter.
|
StreamTarget(OutputStream outputStream, Formatter formatter, String encoding) - 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.
|
m_encoding
private String m_encoding
The encoding to use when creating byte array for string, may be null.
m_outputStream
private OutputStream m_outputStream
OutputStream we are writing to.
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
StreamTarget
public StreamTarget(OutputStream outputStream,
Formatter formatter,
String encoding)
Constructor that writes to a stream and uses a particular formatter.
outputStream
- the OutputStream to write toformatter
- the Formatter to useencoding
- Desired encoding to use when writing to the log, null
implies the default system encoding.
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