org.apache.camel.impl
Class LoggingExceptionHandler

java.lang.Object
  extended by org.apache.camel.impl.LoggingExceptionHandler
All Implemented Interfaces:
ExceptionHandler

public class LoggingExceptionHandler
extends Object
implements 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 DefaultShutdownStrategy.isSuppressLoggingOnTimeout() option to avoid logging if the logging should be suppressed.

Version:

Constructor Summary
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. 
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingExceptionHandler

@Deprecated
public LoggingExceptionHandler(Class<?> ownerType)
Deprecated. 


LoggingExceptionHandler

public LoggingExceptionHandler(CamelContext camelContext,
                               Class<?> ownerType)

LoggingExceptionHandler

@Deprecated
public LoggingExceptionHandler(Class<?> ownerType,
                                          LoggingLevel level)
Deprecated. 


LoggingExceptionHandler

public LoggingExceptionHandler(CamelContext camelContext,
                               Class<?> ownerType,
                               LoggingLevel level)

LoggingExceptionHandler

@Deprecated
public LoggingExceptionHandler(CamelLogger logger)
Deprecated. 


LoggingExceptionHandler

public LoggingExceptionHandler(CamelContext camelContext,
                               CamelLogger logger)
Method Detail

handleException

public void handleException(Throwable exception)
Description copied from interface: ExceptionHandler
Handles the given exception

Specified by:
handleException in interface ExceptionHandler
Parameters:
exception - the exception

handleException

public void handleException(String message,
                            Throwable exception)
Description copied from interface: ExceptionHandler
Handles the given exception

Specified by:
handleException in interface ExceptionHandler
Parameters:
message - additional message
exception - the exception

handleException

public void handleException(String message,
                            Exchange exchange,
                            Throwable exception)
Description copied from interface: ExceptionHandler
Handles the given exception

Specified by:
handleException in interface ExceptionHandler
Parameters:
message - additional message
exchange - exchange which cause the exception
exception - the exception

isCausedByRollbackExchangeException

protected boolean isCausedByRollbackExchangeException(Throwable exception)

isSuppressLogging

protected boolean isSuppressLogging()


Apache Camel