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 ofExceptionHandlerwhich uses aCamelLoggerto log the exception. This implementation will by default log the exception with stack trace at WARN level. This implementation honors theShutdownStrategy.isSuppressLoggingOnTimeout()option to avoid logging if the logging should be suppressed.
-
-
Constructor Summary
Constructors Constructor Description LoggingExceptionHandler(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleException(String message, Throwable exception)voidhandleException(String message, org.apache.camel.Exchange exchange, Throwable exception)voidhandleException(Throwable exception)protected booleanisCausedByRollbackExchangeException(Throwable exception)protected booleanisSuppressLogging()
-
-
-
Constructor Detail
-
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 Detail
-
handleException
public void handleException(Throwable exception)
- Specified by:
handleExceptionin interfaceorg.apache.camel.spi.ExceptionHandler
-
handleException
public void handleException(String message, Throwable exception)
- 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
protected boolean isCausedByRollbackExchangeException(Throwable exception)
-
isSuppressLogging
protected boolean isSuppressLogging()
-
-