Class ContextAwareLogger
- java.lang.Object
-
- org.apache.synapse.commons.logger.ContextAwareLogger
-
public class ContextAwareLogger extends Object
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 Constructor Description ContextAwareLogger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.protected static void
setCorrelationLoggingEnabled(Boolean correlationLoggingEnabled)
-
-
-
Method Detail
-
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
protected static void setCorrelationLoggingEnabled(Boolean correlationLoggingEnabled)
-
-