public class LoggingExceptionHandler extends Object implements org.apache.camel.spi.ExceptionHandler
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 and Description |
---|
LoggingExceptionHandler(org.apache.camel.CamelContext camelContext,
org.apache.camel.spi.CamelLogger logger) |
LoggingExceptionHandler(org.apache.camel.CamelContext camelContext,
Class<?> ownerType) |
LoggingExceptionHandler(org.apache.camel.CamelContext camelContext,
Class<?> ownerType,
org.apache.camel.LoggingLevel level) |
Modifier and Type | Method and Description |
---|---|
void |
handleException(String message,
org.apache.camel.Exchange exchange,
Throwable exception) |
void |
handleException(String message,
Throwable exception) |
void |
handleException(Throwable exception) |
protected boolean |
isCausedByRollbackExchangeException(Throwable exception) |
protected boolean |
isSuppressLogging() |
public LoggingExceptionHandler(org.apache.camel.CamelContext camelContext, Class<?> ownerType)
public LoggingExceptionHandler(org.apache.camel.CamelContext camelContext, Class<?> ownerType, org.apache.camel.LoggingLevel level)
public LoggingExceptionHandler(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.CamelLogger logger)
public void handleException(Throwable exception)
handleException
in interface org.apache.camel.spi.ExceptionHandler
public void handleException(String message, Throwable exception)
handleException
in interface org.apache.camel.spi.ExceptionHandler
public void handleException(String message, org.apache.camel.Exchange exchange, Throwable exception)
handleException
in interface org.apache.camel.spi.ExceptionHandler
protected boolean isCausedByRollbackExchangeException(Throwable exception)
protected boolean isSuppressLogging()
Apache Camel