Package ch.qos.logback.core.net
Class SyslogOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- ch.qos.logback.core.net.SyslogOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class SyslogOutputStream extends java.io.OutputStreamSyslogOutputStream is a wrapper around theDatagramSocketclass so that it behaves like anOutputStream.
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.InetAddressaddressprivate java.io.ByteArrayOutputStreambaosprivate java.net.DatagramSocketdsprivate static intMAX_LENThe maximum length after which we discard the existing string buffer and start anew.private intport
-
Constructor Summary
Constructors Constructor Description SyslogOutputStream(java.lang.String syslogHost, int port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()intgetPort()(package private) intgetSendBufferSize()voidwrite(byte[] byteArray, int offset, int len)voidwrite(int b)
-
-
-
Field Detail
-
MAX_LEN
private static final int MAX_LEN
The maximum length after which we discard the existing string buffer and start anew.- See Also:
- Constant Field Values
-
address
private java.net.InetAddress address
-
ds
private java.net.DatagramSocket ds
-
baos
private java.io.ByteArrayOutputStream baos
-
port
private final int port
-
-
Method Detail
-
write
public void write(byte[] byteArray, int offset, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream
-
getPort
public int getPort()
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
getSendBufferSize
int getSendBufferSize() throws java.net.SocketException- Throws:
java.net.SocketException
-
-