public class AsyncLoggerContext extends LoggerContext
LoggerContext that creates AsyncLogger objects.LifeCycle.StatePROPERTY_CONFIGDEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER| Constructor and Description |
|---|
AsyncLoggerContext(String name) |
AsyncLoggerContext(String name,
Object externalContext) |
AsyncLoggerContext(String name,
Object externalContext,
String configLocn) |
AsyncLoggerContext(String name,
Object externalContext,
URI configLocn) |
| Modifier and Type | Method and Description |
|---|---|
RingBufferAdmin |
createRingBufferAdmin()
Creates and returns a new
RingBufferAdmin that instruments the ringbuffer of the AsyncLogger
objects in this LoggerContext. |
protected Logger |
newInstance(LoggerContext ctx,
String name,
MessageFactory messageFactory) |
void |
setName(String name)
Sets the name.
|
void |
setUseThreadLocals(boolean useThreadLocals)
Signals this context whether it is allowed to use ThreadLocal objects for efficiency.
|
void |
start() |
void |
start(Configuration config)
Starts with a specific configuration.
|
boolean |
stop(long timeout,
TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
addFilter, addPropertyChangeListener, close, getConfigLocation, getConfiguration, getContext, getContext, getContext, getExecutorService, getExecutorServiceDeamons, getExternalContext, getLogger, getLogger, getLoggers, getName, getRootLogger, hasLogger, hasLogger, hasLogger, onChange, reconfigure, removeFilter, removePropertyChangeListener, setConfigLocation, setExternalContext, submit, submitDaemon, terminate, updateLoggers, updateLoggersequalsImpl, getState, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stoppublic AsyncLoggerContext(String name)
protected Logger newInstance(LoggerContext ctx, String name, MessageFactory messageFactory)
newInstance in class LoggerContextpublic void setName(String name)
LoggerContextsetName in class LoggerContextname - the new LoggerContext namepublic void start()
start in interface LifeCyclestart in class LoggerContextpublic void start(Configuration config)
LoggerContextstart in class LoggerContextconfig - The new Configuration.public boolean stop(long timeout,
TimeUnit timeUnit)
LifeCycle2stop in interface LifeCycle2stop in class LoggerContexttimeout - the maximum time to waittimeUnit - the time unit of the timeout argumentpublic RingBufferAdmin createRingBufferAdmin()
RingBufferAdmin that instruments the ringbuffer of the AsyncLogger
objects in this LoggerContext.RingBufferAdmin that instruments the ringbufferpublic void setUseThreadLocals(boolean useThreadLocals)
useThreadLocals - whether this context is allowed to use ThreadLocal objectsCopyright © 1999-2016 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.