public class StreamTarget extends AbstractOutputTarget
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
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 © 1997–2016. All rights reserved.