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 Details

    • LoggingExceptionHandler

      public LoggingExceptionHandler(org.apache.camel.CamelContext camelContext, Class<?> ownerType)
    • 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

      public void handleException(Throwable exception)
      Specified by:
      handleException in interface org.apache.camel.spi.ExceptionHandler
    • handleException

      public void handleException(String message, Throwable exception)
      Specified by:
      handleException in interface org.apache.camel.spi.ExceptionHandler
    • handleException

      public void handleException(String message, org.apache.camel.Exchange exchange, Throwable exception)
      Specified by:
      handleException in interface org.apache.camel.spi.ExceptionHandler
    • isCausedByRollbackExchangeException

      protected boolean isCausedByRollbackExchangeException(Throwable exception)
    • isSuppressLogging

      protected boolean isSuppressLogging()