Search in sources :

Example 1 with AsyncAccessEventAppenderFactory

use of io.dropwizard.request.logging.async.AsyncAccessEventAppenderFactory in project dropwizard by dropwizard.

the class LogbackAccessRequestLogFactory method build.

@Override
public RequestLog build(String name) {
    final Logger logger = (Logger) LoggerFactory.getLogger("http.request");
    logger.setAdditive(false);
    final LoggerContext context = logger.getLoggerContext();
    final LogbackAccessRequestLog requestLog = new LogbackAccessRequestLog();
    final LevelFilterFactory<IAccessEvent> levelFilterFactory = new NullLevelFilterFactory<>();
    final AsyncAppenderFactory<IAccessEvent> asyncAppenderFactory = new AsyncAccessEventAppenderFactory();
    final LayoutFactory<IAccessEvent> layoutFactory = new LogbackAccessRequestLayoutFactory();
    for (AppenderFactory<IAccessEvent> output : appenders) {
        requestLog.addAppender(output.build(context, name, layoutFactory, levelFilterFactory, asyncAppenderFactory));
    }
    return requestLog;
}
Also used : LogbackAccessRequestLayoutFactory(io.dropwizard.request.logging.layout.LogbackAccessRequestLayoutFactory) AsyncAccessEventAppenderFactory(io.dropwizard.request.logging.async.AsyncAccessEventAppenderFactory) IAccessEvent(ch.qos.logback.access.spi.IAccessEvent) NullLevelFilterFactory(io.dropwizard.logging.filter.NullLevelFilterFactory) Logger(ch.qos.logback.classic.Logger) LoggerContext(ch.qos.logback.classic.LoggerContext)

Aggregations

IAccessEvent (ch.qos.logback.access.spi.IAccessEvent)1 Logger (ch.qos.logback.classic.Logger)1 LoggerContext (ch.qos.logback.classic.LoggerContext)1 NullLevelFilterFactory (io.dropwizard.logging.filter.NullLevelFilterFactory)1 AsyncAccessEventAppenderFactory (io.dropwizard.request.logging.async.AsyncAccessEventAppenderFactory)1 LogbackAccessRequestLayoutFactory (io.dropwizard.request.logging.layout.LogbackAccessRequestLayoutFactory)1