public class AsyncLoggerContext extends LoggerContext
LoggerContext
that creates AsyncLogger
objects.LifeCycle.State
PROPERTY_CONFIG
DEFAULT_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, updateLoggers
equalsImpl, getState, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
public AsyncLoggerContext(String name)
protected Logger newInstance(LoggerContext ctx, String name, MessageFactory messageFactory)
newInstance
in class LoggerContext
public void setName(String name)
LoggerContext
setName
in class LoggerContext
name
- the new LoggerContext namepublic void start()
start
in interface LifeCycle
start
in class LoggerContext
public void start(Configuration config)
LoggerContext
start
in class LoggerContext
config
- The new Configuration.public boolean stop(long timeout, TimeUnit timeUnit)
LifeCycle2
stop
in interface LifeCycle2
stop
in class LoggerContext
timeout
- 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.