java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.classic.net.ReceiverBase
ch.qos.logback.classic.net.server.ServerSocketReceiver
- All Implemented Interfaces:
ContextAware,LifeCycle
- Direct Known Subclasses:
SSLServerSocketReceiver
A logging socket server that is configurable using Joran.
- Author:
- Carl Harris
-
Field Summary
FieldsFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ServerListener<ch.qos.logback.classic.net.server.RemoteAppenderClient> createServerListener(ServerSocket socket) protected ServerRunnercreateServerRunner(ServerListener<ch.qos.logback.classic.net.server.RemoteAppenderClient> listener, Executor executor) Gets the local address for the listener.intGets the listener queue depth.protected InetAddressGets the local address for the listener.intgetPort()Gets the local port for the listener.protected RunnableProvides the runnable task this receiver will execute.protected ServerSocketFactoryGets the server socket factory.protected voidonStop()Allows a subclass to participate in receiver shutdown.voidsetAddress(String address) Sets the local address for the listener.voidsetBacklog(int backlog) Sets the listener queue depth.voidsetPort(int port) Sets the local port for the listener.protected booleanStarts the server.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
-
Field Details
-
DEFAULT_BACKLOG
-
-
Constructor Details
-
ServerSocketReceiver
public ServerSocketReceiver()
-
-
Method Details
-
shouldStart
Starts the server.- Specified by:
shouldStartin classReceiverBase- Returns:
- flag indicating whether this receiver should start
-
createServerListener
protected ServerListener<ch.qos.logback.classic.net.server.RemoteAppenderClient> createServerListener(ServerSocket socket) -
createServerRunner
protected ServerRunner createServerRunner(ServerListener<ch.qos.logback.classic.net.server.RemoteAppenderClient> listener, Executor executor) -
getRunnableTask
Description copied from class:ReceiverBaseProvides the runnable task this receiver will execute.- Specified by:
getRunnableTaskin classReceiverBase- Returns:
- runnable task
-
onStop
Allows a subclass to participate in receiver shutdown.- Specified by:
onStopin classReceiverBase
-
getServerSocketFactory
Gets the server socket factory.Subclasses may override to provide a custom factory.
- Returns:
- server socket factory
- Throws:
Exception
-
getInetAddress
Gets the local address for the listener.- Returns:
- an
InetAddressrepresentation of the local address. - Throws:
UnknownHostException
-
getPort
-
setPort
Sets the local port for the listener.- Parameters:
port- the local port to set
-
getBacklog
Gets the listener queue depth.This represents the number of connected clients whose connections have not yet been accepted.
- Returns:
- queue depth
- See Also:
-
setBacklog
Sets the listener queue depth.This represents the number of connected clients whose connections have not yet been accepted.
- Parameters:
backlog- the queue depth to set- See Also:
-
getAddress
Gets the local address for the listener.- Returns:
- a string representation of the local address
-
setAddress
Sets the local address for the listener.- Parameters:
address- a host name or a string representation of an IP address
-