Search in sources :

Example 1 with LoggingErrorHandler

use of org.apache.camel.processor.LoggingErrorHandler in project camel by apache.

the class LoggingErrorHandlerBuilder method createErrorHandler.

public Processor createErrorHandler(final RouteContext routeContext, final Processor processor) {
    CamelLogger logger = new CamelLogger(log, level);
    // configure policy to use the selected logging level, and only log exhausted
    RedeliveryPolicy policy = new RedeliveryPolicy();
    policy.setLogExhausted(true);
    policy.setRetriesExhaustedLogLevel(level);
    policy.setLogStackTrace(true);
    policy.setLogRetryAttempted(false);
    policy.setRetryAttemptedLogLevel(LoggingLevel.OFF);
    policy.setLogRetryStackTrace(false);
    policy.setLogContinued(false);
    policy.setLogHandled(false);
    LoggingErrorHandler handler = new LoggingErrorHandler(routeContext.getCamelContext(), processor, logger, policy, getExceptionPolicyStrategy());
    configure(routeContext, handler);
    return handler;
}
Also used : CamelLogger(org.apache.camel.util.CamelLogger) LoggingErrorHandler(org.apache.camel.processor.LoggingErrorHandler) RedeliveryPolicy(org.apache.camel.processor.RedeliveryPolicy)

Aggregations

LoggingErrorHandler (org.apache.camel.processor.LoggingErrorHandler)1 RedeliveryPolicy (org.apache.camel.processor.RedeliveryPolicy)1 CamelLogger (org.apache.camel.util.CamelLogger)1