use of org.apache.camel.processor.CamelLogProcessor in project camel by apache.
the class LogEndpoint method createLogger.
/**
* Creates the logger {@link Processor} to be used.
*/
protected Processor createLogger() throws Exception {
Processor answer;
// setup a new logger here
CamelLogger camelLogger;
LoggingLevel loggingLevel = LoggingLevel.INFO;
if (level != null) {
loggingLevel = LoggingLevel.valueOf(level);
}
if (providedLogger == null) {
camelLogger = new CamelLogger(loggerName, loggingLevel, getMarker());
} else {
camelLogger = new CamelLogger(providedLogger, loggingLevel, getMarker());
}
if (getGroupSize() != null) {
answer = new ThroughputLogger(camelLogger, getGroupSize());
} else if (getGroupInterval() != null) {
Boolean groupActiveOnly = getGroupActiveOnly() != null ? getGroupActiveOnly() : Boolean.TRUE;
Long groupDelay = getGroupDelay();
answer = new ThroughputLogger(camelLogger, this.getCamelContext(), getGroupInterval(), groupDelay, groupActiveOnly);
} else {
answer = new CamelLogProcessor(camelLogger, localFormatter);
}
// the logger is the processor
setProcessor(answer);
return answer;
}
Aggregations