public class MuleLog4jContextFactory extends org.apache.logging.log4j.core.impl.Log4jContextFactory implements Disposable
LoggerContextFactory
which
acts as the bootstrap for mule's logging mechanism.
It forces ArtifactAwareContextSelector
as
the only selector, XmlConfigurationFactory
as the only available ConfigurationFactory
,
and sets AsyncLoggerExceptionHandler
as the
ExceptionHandler
for failing async loggers.
Other than that, it's pretty much a copy paste of Log4jContextFactory
,
due to that classes' lack of extensibility.
By forcing XmlConfigurationFactory
as the only available
ConfigurationFactory
we're disabling log4j2's ability to
take json and yaml configurations. This is so because those configuration factories
depend on versions of the jackson libraries which would cause conflict with the ones in mule.
TODO: Upgrade the jackson libraries bundled with mule so that this restriction can be lifted offPHASE_NAME
SHUTDOWN_CALLBACK_REGISTRY, SHUTDOWN_HOOK_MARKER
Constructor and Description |
---|
MuleLog4jContextFactory()
Initializes using a
ArtifactAwareContextSelector |
MuleLog4jContextFactory(org.apache.logging.log4j.core.selector.ContextSelector contextSelector)
Initializes using
contextSelector |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected void |
initialise() |
addShutdownCallback, getContext, getContext, getContext, getSelector, removeContext
public MuleLog4jContextFactory()
ArtifactAwareContextSelector
public MuleLog4jContextFactory(org.apache.logging.log4j.core.selector.ContextSelector contextSelector)
contextSelector
contextSelector
- a ContextSelector
protected void initialise()
public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.