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 TypeMethodDescriptionvoidhandleException(String message, Throwable exception) voidhandleException(String message, org.apache.camel.Exchange exchange, Throwable exception) voidhandleException(Throwable exception) protected booleanisCausedByRollbackExchangeException(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:
handleExceptionin interfaceorg.apache.camel.spi.ExceptionHandler
-
handleException
- Specified by:
handleExceptionin interfaceorg.apache.camel.spi.ExceptionHandler
-
handleException
public void handleException(String message, org.apache.camel.Exchange exchange, Throwable exception) - Specified by:
handleExceptionin interfaceorg.apache.camel.spi.ExceptionHandler
-
isCausedByRollbackExchangeException
-
isSuppressLogging
protected boolean isSuppressLogging()
-