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 ofExceptionHandler
which uses aCamelLogger
to 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 void
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
isSuppressLogging()
-
-
-
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:
handleException
in interfaceorg.apache.camel.spi.ExceptionHandler
-
handleException
public void handleException(String message, Throwable exception)
- 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
protected boolean isCausedByRollbackExchangeException(Throwable exception)
-
isSuppressLogging
protected boolean isSuppressLogging()
-
-