use of io.dropwizard.logging.layout.LayoutFactory in project dropwizard by dropwizard.
the class LogbackClassicRequestLogFactory method build.
public RequestLog build(String name) {
final Logger logger = (Logger) LoggerFactory.getLogger("http.request");
logger.setAdditive(false);
final LoggerContext context = logger.getLoggerContext();
final LevelFilterFactory<ILoggingEvent> levelFilterFactory = new NullLevelFilterFactory<>();
final AsyncAppenderFactory<ILoggingEvent> asyncAppenderFactory = new AsyncLoggingEventAppenderFactory();
final LayoutFactory<ILoggingEvent> layoutFactory = (c, tz) -> new RequestLogLayout();
final AppenderAttachableImpl<ILoggingEvent> attachable = new AppenderAttachableImpl<>();
for (AppenderFactory<ILoggingEvent> appender : appenders) {
attachable.addAppender(appender.build(context, name, layoutFactory, levelFilterFactory, asyncAppenderFactory));
}
return new DropwizardSlf4jRequestLog(attachable, timeZone);
}
Aggregations