SocketAppender implementations
in other logback modules.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private InetAddress | |
| private SocketConnector | |
| private static final int | DEFAULT_ACCEPT_CONNECTION_DELAY
Default timeout when waiting for the remote server to accept our connection. |
| private static final int | DEFAULT_EVENT_DELAY_TIMEOUT
Default timeout for how long to wait when inserting an event into the BlockingQueue. |
| public static final int | DEFAULT_PORT
The default port number of remote logging server (4560). |
| public static final int | DEFAULT_QUEUE_SIZE
Default size of the deque used to hold logging events that are destined for the remote peer. |
| public static final int | DEFAULT_RECONNECTION_DELAY
The default reconnection delay (30000 milliseconds or 30 seconds). |
| private BlockingDeque | |
| private Duration | |
| private final ObjectWriterFactory | |
| private String | |
| private int | |
| private final QueueFactory | |
| private int | |
| private Duration | |
| private String | |
| private volatile Socket | |
| private Future |
| Access | Constructor and Description |
|---|---|
| protected | |
| pack-priv | AbstractSocketAppender(QueueFactory queueFactory, ObjectWriterFactory objectWriterFactory)
Constructs a new appender using the given |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | connectionFailed(SocketConnector connector, Exception ex)
Implements ch. |
| private void | |
| private SocketConnector | |
| private ObjectWriter | |
| private void | |
| public Duration | |
| public int | |
| protected abstract PreSerializationTransformer | Returns: transformer objectGet the pre-serialization transformer that will be used to transform each event into a Serializable object before delivery to the remote receiver. |
| public int | |
| public Duration | |
| public String | |
| protected SocketFactory | |
| protected SocketConnector | Returns: socket connectortarget remote address address, int target remote port port, long delay before the first connection attempt initialDelay, long delay before a reconnection attempt retryDelay)Creates a new |
| protected abstract void | postProcessEvent(E
the event to post-process event)Post-processes an event before it is serialized for delivery to the remote receiver. |
| pack-priv void | setAcceptConnectionTimeout(int
timeout value in milliseconds acceptConnectionTimeout)Sets the timeout that controls how long we'll wait for the remote peer to accept our connection attempt. |
| public void | setEventDelayLimit(Duration
the event delay limit eventDelayLimit)The eventDelayLimit takes a non-negative integer representing the number of milliseconds to allow the appender to block if the underlying BlockingQueue is full. |
| public void | setPort(int port)
The Port property takes a positive integer representing the port where the server is waiting for connections. |
| public void | setQueueSize(int
the deque size to set. queueSize)The queueSize property takes a non-negative integer representing the number of logging events to retain for delivery to the remote receiver. |
| public void | setReconnectionDelay(Duration delay)
The reconnectionDelay property takes a positive |
| public void | setRemoteHost(String host)
The RemoteHost property takes the name of the host where a corresponding server is running. |
| private boolean | |
| public void | start()
Overrides ch. Implements ch. |
| public void | stop()
Overrides ch. Implements ch. |
| private void |
| acceptConnectionTimeout | back to summary |
|---|---|
| private int acceptConnectionTimeout | |
| address | back to summary |
|---|---|
| private InetAddress address | |
| connector | back to summary |
|---|---|
| private SocketConnector connector | |
| DEFAULT_ACCEPT_CONNECTION_DELAY | back to summary |
|---|---|
| private static final int DEFAULT_ACCEPT_CONNECTION_DELAY Default timeout when waiting for the remote server to accept our connection. | |
| DEFAULT_EVENT_DELAY_TIMEOUT | back to summary |
|---|---|
| private static final int DEFAULT_EVENT_DELAY_TIMEOUT Default timeout for how long to wait when inserting an event into the BlockingQueue. | |
| DEFAULT_PORT | back to summary |
|---|---|
| public static final int DEFAULT_PORT The default port number of remote logging server (4560). | |
| DEFAULT_QUEUE_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_QUEUE_SIZE Default size of the deque used to hold logging events that are destined for the remote peer. | |
| DEFAULT_RECONNECTION_DELAY | back to summary |
|---|---|
| public static final int DEFAULT_RECONNECTION_DELAY The default reconnection delay (30000 milliseconds or 30 seconds). | |
| deque | back to summary |
|---|---|
| private BlockingDeque<E> deque | |
| eventDelayLimit | back to summary |
|---|---|
| private Duration eventDelayLimit | |
| objectWriterFactory | back to summary |
|---|---|
| private final ObjectWriterFactory objectWriterFactory | |
| peerId | back to summary |
|---|---|
| private String peerId | |
| port | back to summary |
|---|---|
| private int port | |
| queueFactory | back to summary |
|---|---|
| private final QueueFactory queueFactory | |
| queueSize | back to summary |
|---|---|
| private int queueSize | |
| reconnectionDelay | back to summary |
|---|---|
| private Duration reconnectionDelay | |
| remoteHost | back to summary |
|---|---|
| private String remoteHost | |
| socket | back to summary |
|---|---|
| private volatile Socket socket | |
| task | back to summary |
|---|---|
| private Future<?> task | |
| AbstractSocketAppender | back to summary |
|---|---|
| protected AbstractSocketAppender() Constructs a new appender. | |
| AbstractSocketAppender | back to summary |
|---|---|
| pack-priv AbstractSocketAppender(QueueFactory queueFactory, ObjectWriterFactory objectWriterFactory) Constructs a new appender using the given | |
| append | back to summary |
|---|---|
| protected void append(E event) Implements abstract ch.
| |
| connectionFailed | back to summary |
|---|---|
| public void connectionFailed(SocketConnector connector, Exception ex) Implements ch. | |
| connectSocketAndDispatchEvents | back to summary |
|---|---|
| private void connectSocketAndDispatchEvents() | |
| createConnector | back to summary |
|---|---|
| private SocketConnector createConnector(InetAddress address, int port, int initialDelay, long retryDelay) | |
| createObjectWriterForSocket | back to summary |
|---|---|
| private ObjectWriter createObjectWriterForSocket() throws IOException | |
| dispatchEvents | back to summary |
|---|---|
| private void dispatchEvents(ObjectWriter objectWriter) throws InterruptedException, IOException | |
| getEventDelayLimit | back to summary |
|---|---|
| public Duration getEventDelayLimit() Returns the value of the eventDelayLimit property. | |
| getPort | back to summary |
|---|---|
| public int getPort() Returns value of the Port property. | |
| getPST | back to summary |
|---|---|
| protected abstract PreSerializationTransformer Get the pre-serialization transformer that will be used to transform each event into a Serializable object before delivery to the remote receiver.
| |
| getQueueSize | back to summary |
|---|---|
| public int getQueueSize() Returns the value of the queueSize property. | |
| getReconnectionDelay | back to summary |
|---|---|
| public Duration getReconnectionDelay() Returns value of the reconnectionDelay property. | |
| getRemoteHost | back to summary |
|---|---|
| public String getRemoteHost() Returns value of the RemoteHost property. | |
| getSocketFactory | back to summary |
|---|---|
| protected SocketFactory getSocketFactory() Gets the default Subclasses may override to provide a custom socket factory. | |
| newConnector | back to summary |
|---|---|
| protected SocketConnector newConnector(InetAddress address, int port, long initialDelay, long retryDelay) Creates a new
The default implementation creates an instance of
| |
| postProcessEvent | back to summary |
|---|---|
| protected abstract void postProcessEvent(E event) Post-processes an event before it is serialized for delivery to the remote receiver.
| |
| setAcceptConnectionTimeout | back to summary |
|---|---|
| pack-priv void setAcceptConnectionTimeout(int acceptConnectionTimeout) Sets the timeout that controls how long we'll wait for the remote peer to accept our connection attempt. This property is configurable primarily to support instrumentation for unit testing.
| |
| setEventDelayLimit | back to summary |
|---|---|
| public void setEventDelayLimit(Duration eventDelayLimit) The eventDelayLimit takes a non-negative integer representing the number of milliseconds to allow the appender to block if the underlying BlockingQueue is full. Once this limit is reached, the event is dropped.
| |
| setPort | back to summary |
|---|---|
| public void setPort(int port) The Port property takes a positive integer representing the port where the server is waiting for connections. | |
| setQueueSize | back to summary |
|---|---|
| public void setQueueSize(int queueSize) The queueSize property takes a non-negative integer representing the
number of logging events to retain for delivery to the remote receiver. When
the deque size is zero, event delivery to the remote receiver is synchronous.
When the deque size is greater than zero, the
| |
| setReconnectionDelay | back to summary |
|---|---|
| public void setReconnectionDelay(Duration delay) The reconnectionDelay property takes a positive Setting this option to zero turns off reconnection capability. | |
| setRemoteHost | back to summary |
|---|---|
| public void setRemoteHost(String host) The RemoteHost property takes the name of the host where a corresponding server is running. | |
| socketConnectionCouldBeEstablished | back to summary |
|---|---|
| private boolean socketConnectionCouldBeEstablished() throws InterruptedException | |
| start | back to summary |
|---|---|
| public void start() Overrides ch. Implements ch. | |
| stop | back to summary |
|---|---|
| public void stop() Overrides ch. Implements ch.
| |
| tryReAddingEventToFrontOfQueue | back to summary |
|---|---|
| private void tryReAddingEventToFrontOfQueue(E event) | |