|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
ch.qos.logback.core.net.AbstractSocketAppender<E>
public abstract class AbstractSocketAppender<E>
An abstract base for module specific SocketAppender
implementations in other logback modules.
Field Summary | |
---|---|
static int |
DEFAULT_PORT
The default port number of remote logging server (4560). |
static int |
DEFAULT_QUEUE_SIZE
Default size of the queue used to hold logging events that are destined for the remote peer. |
static int |
DEFAULT_RECONNECTION_DELAY
The default reconnection delay (30000 milliseconds or 30 seconds). |
Fields inherited from class ch.qos.logback.core.AppenderBase |
---|
name, started |
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
context |
Constructor Summary | |
---|---|
protected |
AbstractSocketAppender()
Constructs a new appender. |
Method Summary | |
---|---|
protected void |
append(E event)
|
void |
connectionFailed(SocketConnector connector,
Exception ex)
|
protected static InetAddress |
getAddressByName(String host)
Deprecated. |
Duration |
getEventDelayLimit()
Returns the value of the eventDelayLimit property. |
int |
getPort()
Returns value of the Port property. |
protected abstract PreSerializationTransformer<E> |
getPST()
Get the pre-serialization transformer that will be used to transform each event into a Serializable object before delivery to the remote receiver. |
int |
getQueueSize()
Returns the value of the queueSize property. |
Duration |
getReconnectionDelay()
Returns value of the reconnectionDelay property. |
String |
getRemoteHost()
Returns value of the RemoteHost property. |
protected SocketFactory |
getSocketFactory()
Gets the default SocketFactory for the platform. |
protected SocketConnector |
newConnector(InetAddress address,
int port,
long initialDelay,
long retryDelay)
Creates a new SocketConnector . |
protected abstract void |
postProcessEvent(E event)
Post-processes an event before it is serialized for delivery to the remote receiver. |
void |
run()
|
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. |
void |
setPort(int port)
The Port property takes a positive integer representing the port where the server is waiting for connections. |
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. |
void |
setReconnectionDelay(Duration delay)
The reconnectionDelay property takes a positive Duration value
representing the time to wait between each failed connection attempt
to the server. |
void |
setRemoteHost(String host)
The RemoteHost property takes the name of of the host where a corresponding server is running. |
protected void |
signalEntryInRunMethod()
|
void |
start()
|
void |
stop()
|
Methods inherited from class ch.qos.logback.core.AppenderBase |
---|
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString |
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ch.qos.logback.core.spi.ContextAware |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext |
Field Detail |
---|
public static final int DEFAULT_PORT
public static final int DEFAULT_RECONNECTION_DELAY
public static final int DEFAULT_QUEUE_SIZE
Constructor Detail |
---|
protected AbstractSocketAppender()
Method Detail |
---|
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
public void stop()
stop
in interface LifeCycle
stop
in class AppenderBase<E>
protected void append(E event)
append
in class AppenderBase<E>
public final void run()
run
in interface Runnable
protected void signalEntryInRunMethod()
public void connectionFailed(SocketConnector connector, Exception ex)
connectionFailed
in interface SocketConnector.ExceptionHandler
protected SocketConnector newConnector(InetAddress address, int port, long initialDelay, long retryDelay)
SocketConnector
.
The default implementation creates an instance of DefaultSocketConnector
.
A subclass may override to provide a different SocketConnector
implementation.
address
- target remote addressport
- target remote portinitialDelay
- delay before the first connection attemptretryDelay
- delay before a reconnection attempt
protected SocketFactory getSocketFactory()
SocketFactory
for the platform.
Subclasses may override to provide a custom socket factory.
protected abstract void postProcessEvent(E event)
event
- the event to post-processprotected abstract PreSerializationTransformer<E> getPST()
@Deprecated protected static InetAddress getAddressByName(String host)
public void setRemoteHost(String host)
public String getRemoteHost()
public void setPort(int port)
public int getPort()
public void setReconnectionDelay(Duration delay)
Duration
value
representing the time to wait between each failed connection attempt
to the server. The default value of this option is to 30 seconds.
Setting this option to zero turns off reconnection capability.
public Duration getReconnectionDelay()
public void setQueueSize(int queueSize)
append(Object)
method returns immediately after enqueing the
event, assuming that there is space available in the queue. Using a
non-zero queue length can improve performance by eliminating delays
caused by transient network delays.
queueSize
- the queue size to set.public int getQueueSize()
public void setEventDelayLimit(Duration eventDelayLimit)
eventDelayLimit
- the event delay limitpublic Duration getEventDelayLimit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |