org.apache.log.output.net
public class SocketOutputTarget extends AbstractOutputTarget
Modifier and Type | Field and Description |
---|---|
private ObjectOutputStream |
m_outputStream
Output strem to write the log
|
private Socket |
m_socket
Socket to communicate with the server
|
Constructor and Description |
---|
SocketOutputTarget(InetAddress address,
int port)
Creates output target with the end point specified by the address and port
|
SocketOutputTarget(String host,
int port)
Creates the output target with the end point specified by host and port
|
Modifier and Type | Method and 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 Socket m_socket
private ObjectOutputStream m_outputStream
public SocketOutputTarget(InetAddress address, int port) throws IOException
address
- end point addressport
- the end point portIOException
- if an I/O error ocurrs when creating socketpublic SocketOutputTarget(String host, int port) throws IOException
host
- end point hostport
- the end point portIOException
- 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.