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;
}
Aggregations