ErrorAware
, LogTarget
, Closeable
public class SocketOutputTarget extends AbstractOutputTarget
Modifier and Type | Field | Description |
---|---|---|
private java.io.ObjectOutputStream |
m_outputStream |
Output strem to write the log
|
private java.net.Socket |
m_socket |
Socket to communicate with the server
|
Constructor | Description |
---|---|
SocketOutputTarget(java.lang.String host,
int port) |
Creates the output target with the end point specified by host and port
|
SocketOutputTarget(java.net.InetAddress address,
int port) |
Creates output target with the end point specified by the address and port
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
Shutdown target.
|
protected void |
doProcessEvent(LogEvent event) |
To process the LogEvent
|
protected void |
write(LogEvent event) |
Writes the output as a LogEvent without formatting.
|
getFormatter, open, write
getErrorHandler, isOpen, processEvent, setErrorHandler
private java.net.Socket m_socket
private java.io.ObjectOutputStream m_outputStream
public SocketOutputTarget(java.net.InetAddress address, int port) throws java.io.IOException
address
- end point addressport
- the end point portjava.io.IOException
- if an I/O error ocurrs when creating socketpublic SocketOutputTarget(java.lang.String host, int port) throws java.io.IOException
host
- end point hostport
- the end point portjava.io.IOException
- if an I/O error ocurrs when creating socketprotected void write(LogEvent event)
event
- the LogEventprotected void doProcessEvent(LogEvent event)
doProcessEvent
in class AbstractOutputTarget
event
- the LogEventpublic void close()
close
in interface Closeable
close
in class AbstractOutputTarget
Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.