Package org.apache.camel.support
Class LoggingExceptionHandler
java.lang.Object
org.apache.camel.support.LoggingExceptionHandler
- All Implemented Interfaces:
org.apache.camel.spi.ExceptionHandler
public class LoggingExceptionHandler
extends Object
implements org.apache.camel.spi.ExceptionHandler
A default implementation of
ExceptionHandler
which uses a CamelLogger
to log the exception.
This implementation will by default log the exception with stack trace at WARN level.
This implementation honors the ShutdownStrategy.isSuppressLoggingOnTimeout()
option to
avoid logging if the logging should be suppressed.-
Constructor Summary
ConstructorsConstructorDescriptionLoggingExceptionHandler
(org.apache.camel.CamelContext camelContext, Class<?> ownerType) LoggingExceptionHandler
(org.apache.camel.CamelContext camelContext, Class<?> ownerType, org.apache.camel.LoggingLevel level) LoggingExceptionHandler
(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.CamelLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleException
(String message, Throwable exception) void
handleException
(String message, org.apache.camel.Exchange exchange, Throwable exception) void
handleException
(Throwable exception) protected boolean
isCausedByRollbackExchangeException
(Throwable exception) protected boolean
-
Constructor Details
-
LoggingExceptionHandler
-
LoggingExceptionHandler
public LoggingExceptionHandler(org.apache.camel.CamelContext camelContext, Class<?> ownerType, org.apache.camel.LoggingLevel level) -
LoggingExceptionHandler
public LoggingExceptionHandler(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.CamelLogger logger)
-
-
Method Details
-
handleException
- Specified by:
handleException
in interfaceorg.apache.camel.spi.ExceptionHandler
-
handleException
- Specified by:
handleException
in interfaceorg.apache.camel.spi.ExceptionHandler
-
handleException
public void handleException(String message, org.apache.camel.Exchange exchange, Throwable exception) - Specified by:
handleException
in interfaceorg.apache.camel.spi.ExceptionHandler
-
isCausedByRollbackExchangeException
-
isSuppressLogging
protected boolean isSuppressLogging()
-