Class ContextAwareLogger
java.lang.Object
org.apache.synapse.commons.logger.ContextAwareLogger
This class provides the relevant context aware logging wrapper implementation according to the availability of
the correlation id in the provided context and based on the expected behavior of the MDC.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.logging.LoggetLogger(org.apache.axis2.context.MessageContext axis2MessageContext, org.apache.commons.logging.Log log, boolean removeFromMDC) Provides a wrapper implementation for the given logger according to the availability of the correlation id in the axis2 and based on the expected behavior of the Correlation-ID MDC property.static org.apache.commons.logging.LoggetLogger(org.apache.http.protocol.HttpContext httpContext, org.apache.commons.logging.Log log, boolean removeFromMDC) Provides a wrapper implementation for the given logger according to the availability of the correlation id in the httpcontext and based on the expected behavior of the Correlation-ID MDC property.static voidsetCorrelationLoggingEnabled(Boolean correlationLoggingEnabled)
-
Constructor Details
-
ContextAwareLogger
public ContextAwareLogger()
-
-
Method Details
-
getLogger
public static org.apache.commons.logging.Log getLogger(org.apache.axis2.context.MessageContext axis2MessageContext, org.apache.commons.logging.Log log, boolean removeFromMDC) Provides a wrapper implementation for the given logger according to the availability of the correlation id in the axis2 and based on the expected behavior of the Correlation-ID MDC property.- Parameters:
axis2MessageContext- Axis2MessageContextlog- LogremoveFromMDC- whether to remove the Correlation-ID property from MDC after logging- Returns:
- log wrapper
-
getLogger
public static org.apache.commons.logging.Log getLogger(org.apache.http.protocol.HttpContext httpContext, org.apache.commons.logging.Log log, boolean removeFromMDC) Provides a wrapper implementation for the given logger according to the availability of the correlation id in the httpcontext and based on the expected behavior of the Correlation-ID MDC property.- Parameters:
httpContext- HttpContextlog- LogremoveFromMDC- whether to remove the Correlation-ID property from MDC after logging- Returns:
- log wrapper
-
setCorrelationLoggingEnabled
-