public class LoggingExceptionHandler extends Object implements 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(CamelContext camelContext,
CamelLogger logger) |
LoggingExceptionHandler(CamelContext camelContext,
Class<?> ownerType) |
LoggingExceptionHandler(CamelContext camelContext,
Class<?> ownerType,
LoggingLevel level) |
LoggingExceptionHandler(CamelLogger logger)
Deprecated.
|
LoggingExceptionHandler(Class<?> ownerType)
Deprecated.
|
LoggingExceptionHandler(Class<?> ownerType,
LoggingLevel level)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
handleException(String message,
Exchange exchange,
Throwable exception)
Handles the given exception
|
void |
handleException(String message,
Throwable exception)
Handles the given exception
|
void |
handleException(Throwable exception)
Handles the given exception
|
protected boolean |
isCausedByRollbackExchangeException(Throwable exception) |
protected boolean |
isSuppressLogging() |
@Deprecated public LoggingExceptionHandler(Class<?> ownerType)
public LoggingExceptionHandler(CamelContext camelContext, Class<?> ownerType)
@Deprecated public LoggingExceptionHandler(Class<?> ownerType, LoggingLevel level)
public LoggingExceptionHandler(CamelContext camelContext, Class<?> ownerType, LoggingLevel level)
@Deprecated public LoggingExceptionHandler(CamelLogger logger)
public LoggingExceptionHandler(CamelContext camelContext, CamelLogger logger)
public void handleException(Throwable exception)
ExceptionHandler
handleException
in interface ExceptionHandler
exception
- the exceptionpublic void handleException(String message, Throwable exception)
ExceptionHandler
handleException
in interface ExceptionHandler
message
- additional messageexception
- the exceptionpublic void handleException(String message, Exchange exchange, Throwable exception)
ExceptionHandler
handleException
in interface ExceptionHandler
message
- additional messageexchange
- exchange which cause the exceptionexception
- the exceptionprotected boolean isCausedByRollbackExchangeException(Throwable exception)
protected boolean isSuppressLogging()
Apache Camel