java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.classic.net.ReceiverBase
ch.qos.logback.classic.net.SocketReceiver
- All Implemented Interfaces:
SocketConnector.ExceptionHandler,ContextAware,LifeCycle,Runnable
- Direct Known Subclasses:
SSLSocketReceiver
public class SocketReceiver
extends ReceiverBase
implements Runnable, SocketConnector.ExceptionHandler
A component that receives serialized
ILoggingEvent objects from a
remote appender over a Socket.- Author:
- Carl Harris
-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionFailed(SocketConnector connector, Exception ex) protected RunnableProvides the runnable task this receiver will execute.protected SocketFactoryprotected SocketConnectornewConnector(InetAddress address, int port, int initialDelay, int retryDelay) protected voidonStop()Allows a subclass to participate in receiver shutdown.voidrun()voidsetAcceptConnectionTimeout(int acceptConnectionTimeout) voidsetPort(int port) voidsetReconnectionDelay(int reconnectionDelay) voidsetRemoteHost(String remoteHost) protected booleanDetermines whether this receiver should start.Methods inherited from class ch.qos.logback.classic.net.ReceiverBase
isStarted, start, stopMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Constructor Details
-
SocketReceiver
public SocketReceiver()
-
-
Method Details
-
shouldStart
Determines whether this receiver should start.Subclasses will implement this method to do any subclass-specific validation. The subclass's
ReceiverBase.getRunnableTask()method will be invoked (and the task returned will be submitted to the executor) if and only if this method returnstrue- Specified by:
shouldStartin classReceiverBase- Returns:
- flag indicating whether this receiver should start
-
onStop
Allows a subclass to participate in receiver shutdown.- Specified by:
onStopin classReceiverBase
-
getRunnableTask
Description copied from class:ReceiverBaseProvides the runnable task this receiver will execute.- Specified by:
getRunnableTaskin classReceiverBase- Returns:
- runnable task
-
run
-
connectionFailed
- Specified by:
connectionFailedin interfaceSocketConnector.ExceptionHandler
-
newConnector
protected SocketConnector newConnector(InetAddress address, int port, int initialDelay, int retryDelay) -
getSocketFactory
-
setRemoteHost
-
setPort
-
setReconnectionDelay
-
setAcceptConnectionTimeout
-