Java 类ch.qos.logback.core.spi.AppenderAttachableImpl 实例源码

项目:grails-lightweight-deploy    文件:AsyncRequestLog.java   
public AsyncRequestLog(Clock clock,
                       AppenderAttachableImpl<ILoggingEvent> appenders,
                       final TimeZone timeZone,
                       List<String> cookies) {
    this.clock = clock;
    this.cookies = cookies;
    this.queue = new LinkedBlockingQueue<String>();
    this.dispatcher = new Dispatcher();
    this.dispatchThread = new Thread(dispatcher);
    dispatchThread.setName("async-request-log-dispatcher-" + THREAD_COUNTER.incrementAndGet());
    dispatchThread.setDaemon(true);

    this.dateCache = new ThreadLocal<DateCache>() {
        @Override
        protected DateCache initialValue() {
            final DateCache cache = new DateCache("dd/MMM/yyyy:HH:mm:ss Z", Locale.US);
            cache.setTimeZoneID(timeZone.getID());
            return cache;
        }
    };

    this.appenders = appenders;
}
项目:konker-platform    文件:KonkerLogger.java   
public synchronized void addAppender(Appender<ILoggingEvent> newAppender) {
    if(this.aai == null) {
        this.aai = new AppenderAttachableImpl();
    }

    this.aai.addAppender(newAppender);
}
项目:grails-lightweight-deploy    文件:RequestLoggingFactory.java   
public Handler configure() {

        final Logger logger = (Logger) LoggerFactory.getLogger("http.request");
        logger.setAdditive(false);

        final LoggerContext context = logger.getLoggerContext();

        final AppenderAttachableImpl<ILoggingEvent> appenders = new AppenderAttachableImpl<ILoggingEvent>();

        final RequestLogLayout layout = new RequestLogLayout();
        layout.start();

        for (OutputStreamAppender<ILoggingEvent> appender : LogbackFactory.buildAppenders(config.getRequestLogConfiguration(),
                context)) {
            appender.stop();
            appender.setLayout(layout);
            appender.start();
            appenders.addAppender(appender);
        }

        final RequestLogHandler handler = new RequestLogHandler();
        handler.setRequestLog(new AsyncRequestLog(Clock.defaultClock(),
                appenders,
                config.getRequestLogConfiguration().getTimeZone(),
                config.getRequestLogConfiguration().getCookies()));

        return handler;

    }
项目:bartleby    文件:Logger.java   
public synchronized void addAppender(Appender<ILoggingEvent> newAppender) {
  if (aai == null) {
    aai = new AppenderAttachableImpl<ILoggingEvent>();
  }
  aai.addAppender(newAppender);
}