|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.output.AbstractTarget
org.apache.log.output.AbstractOutputTarget
org.apache.log.output.net.DatagramOutputTarget
public class DatagramOutputTarget
A datagram output target. Useful for writing using custom protocols or writing to syslog daemons.
Field Summary | |
---|---|
private static String |
DEFAULT_ENCODING
|
private String |
m_encoding
|
private DatagramSocket |
m_socket
|
Constructor Summary | |
---|---|
DatagramOutputTarget(InetAddress address,
int port)
Create a output target with end point specified by address and port. |
|
DatagramOutputTarget(InetAddress address,
int port,
Formatter formatter)
Create a output target with end point specified by address and port. |
|
DatagramOutputTarget(InetAddress address,
int port,
Formatter formatter,
String encoding)
Create a output target with end point specified by address and port. |
Method Summary | |
---|---|
void |
close()
Shutdown target. |
protected void |
write(String stringData)
Method to write output to datagram. |
Methods inherited from class org.apache.log.output.AbstractOutputTarget |
---|
doProcessEvent, getFormatter, open |
Methods inherited from class org.apache.log.output.AbstractTarget |
---|
getErrorHandler, isOpen, processEvent, setErrorHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String DEFAULT_ENCODING
private DatagramSocket m_socket
private String m_encoding
Constructor Detail |
---|
public DatagramOutputTarget(InetAddress address, int port, Formatter formatter, String encoding) throws IOException
address
- the address endpointport
- the address portformatter
- the message formatterencoding
- the encoding to use when encoding string
IOException
- if an error occurspublic DatagramOutputTarget(InetAddress address, int port, Formatter formatter) throws IOException
address
- the address endpointport
- the address portformatter
- the message formatter
IOException
- if an error occurspublic DatagramOutputTarget(InetAddress address, int port) throws IOException
address
- the address endpointport
- the address port
IOException
- if an error occursMethod Detail |
---|
protected void write(String stringData)
write
in class AbstractOutputTarget
stringData
- the data to be outputpublic void close()
close
in interface Closeable
close
in class AbstractOutputTarget
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |