本文整理汇总了Java中ch.qos.logback.core.spi.AppenderAttachableImpl类的典型用法代码示例。如果您正苦于以下问题:Java AppenderAttachableImpl类的具体用法?Java AppenderAttachableImpl怎么用?Java AppenderAttachableImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppenderAttachableImpl类属于ch.qos.logback.core.spi包,在下文中一共展示了AppenderAttachableImpl类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AsyncRequestLog
import ch.qos.logback.core.spi.AppenderAttachableImpl; //导入依赖的package包/类
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;
}
示例2: configure
import ch.qos.logback.core.spi.AppenderAttachableImpl; //导入依赖的package包/类
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;
}
示例3: addAppender
import ch.qos.logback.core.spi.AppenderAttachableImpl; //导入依赖的package包/类
public synchronized void addAppender(Appender<ILoggingEvent> newAppender) {
if(this.aai == null) {
this.aai = new AppenderAttachableImpl();
}
this.aai.addAppender(newAppender);
}
示例4: addAppender
import ch.qos.logback.core.spi.AppenderAttachableImpl; //导入依赖的package包/类
public synchronized void addAppender(Appender<ILoggingEvent> newAppender) {
if (aai == null) {
aai = new AppenderAttachableImpl<ILoggingEvent>();
}
aai.addAppender(newAppender);
}