org.apache.log.output.io
public class StreamTarget extends AbstractOutputTarget
Modifier and Type | Field and Description |
---|---|
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.
|
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
doProcessEvent, getFormatter, open
getErrorHandler, isOpen, processEvent, setErrorHandler
private OutputStream m_outputStream
private String m_encoding
public StreamTarget(OutputStream outputStream, Formatter formatter, String encoding)
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.public StreamTarget(OutputStream outputStream, Formatter formatter)
outputStream
- the OutputStream to write toformatter
- the Formatter to useprotected void setOutputStream(OutputStream outputStream)
outputStream
- the new OutputStreamprotected void write(String data)
write
in class AbstractOutputTarget
data
- the data to be outputpublic void close()
close
in interface Closeable
close
in class AbstractOutputTarget
protected void shutdownStream()
Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.