ch.qos.logback.core.Appender.isStarted()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中ch.qos.logback.core.Appender.isStarted()方法的一些代码示例,展示了Appender.isStarted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Appender.isStarted()方法的具体详情如下:
包路径:ch.qos.logback.core.Appender
类名称:Appender
方法名:isStarted

Appender.isStarted介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-security

private void redirectLogsTo(OutputStream os, Class<?> clazz) {
  Logger logger = (Logger) LoggerFactory.getLogger(clazz);
  Appender<ILoggingEvent> appender = mock(Appender.class);
  when(appender.isStarted()).thenReturn(true);
  doAnswer(writeTo(os)).when(appender).doAppend(any(ILoggingEvent.class));
  logger.addAppender(appender);
}

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
protected boolean isComponentStale(Appender<E> appender) {
 return !appender.isStarted();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

private boolean isEntryStale(Entry entry, long now) {
 // stopped or improperly started appenders are considered stale
 // see also http://jira.qos.ch/browse/LBCLASSIC-316
 if(!entry.value.isStarted())
  return true;
 // unused appenders are also considered stale
 return ((entry.timestamp + THRESHOLD) < now);
}

代码示例来源:origin: Nextdoor/bender

@Override
protected boolean isComponentStale(Appender<E> appender) {
  return !appender.isStarted();
}

代码示例来源:origin: ch.qos.logback/core

private boolean isEntryStale(Entry entry, long now) {
 // stopped or improperly started appenders are considered stale
 // see also http://jira.qos.ch/browse/LBCLASSIC-316
 if(!entry.value.isStarted())
  return true;
 // unused appenders are also considered stale
 return ((entry.timestamp + THRESHOLD) < now);
}

代码示例来源:origin: tony19/logback-android

@Override
protected boolean isComponentStale(Appender<E> appender) {
 return !appender.isStarted();
}

代码示例来源:origin: caskdata/cdap

@Override
public boolean isStarted() {
 return delegate.isStarted();
}

代码示例来源:origin: co.cask.cdap/cdap-watchdog

@Override
public boolean isStarted() {
 return delegate.isStarted();
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

@Override
protected boolean isComponentStale(Appender<E> appender) {
  return !appender.isStarted();
}

代码示例来源:origin: com.hynnet/logback-core

@Override
protected boolean isComponentStale(Appender<E> appender) {
 return !appender.isStarted();
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

@Override
protected boolean isComponentStale(Appender<E> appender) {
  return !appender.isStarted();
}

代码示例来源:origin: io.projectreactor/reactor-logback

private void startDelegateAppender() {
  Appender<ILoggingEvent> delegateAppender = delegate.get();
  if (null != delegateAppender && !delegateAppender.isStarted()) {
    delegateAppender.start();
  }
}

代码示例来源:origin: io.projectreactor.addons/reactor-logback

private void startDelegateAppender() {
  Appender<ILoggingEvent> delegateAppender = delegate.get();
  if (null != delegateAppender && !delegateAppender.isStarted()) {
    delegateAppender.start();
  }
}

代码示例来源:origin: net.logstash.logback/logstash-logback-encoder

private void stopDelegateAppenders() {
  for (Iterator<Appender<Event>> appenderIter = appenders.iteratorForAppenders(); appenderIter.hasNext();) {
    Appender<Event> appender = appenderIter.next();
    if (appender.isStarted()) {
      appender.stop();
    }
  }
}

代码示例来源:origin: net.logstash.logback/logstash-logback-encoder

private void startDelegateAppenders() {
  for (Iterator<Appender<Event>> appenderIter = appenders.iteratorForAppenders(); appenderIter.hasNext();) {
    Appender<Event> appender = appenderIter.next();
    if (appender.getContext() == null) {
      appender.setContext(getContext());
    }
    if (!appender.isStarted()) {
      appender.start();
    }
  }
}

代码示例来源:origin: tony19/logback-android

@Test
public void smoke() {
 Appender<Object> a = appenderTracker.getOrCreate(key, now);
 assertTrue(a.isStarted());
 now += AppenderTracker.DEFAULT_TIMEOUT + 1;
 appenderTracker.removeStaleComponents(now);
 assertFalse(a.isStarted());
 assertNull(appenderTracker.find(key));
}

代码示例来源:origin: tony19/logback-android

@Test
public void testConfiguredAppender() {
 Appender<E> appender = getConfiguredAppender();
 appender.start();
 assertTrue(appender.isStarted());
  appender.stop();
 assertFalse(appender.isStarted());
 
}

代码示例来源:origin: tony19/logback-android

@Test
public void testNewAppender() {
 // new appenders should be inactive
 Appender<E> appender = getAppender();
 assertFalse( appender.isStarted()); 
}

代码示例来源:origin: tony19/logback-android

@Test
public void trackerShouldHonorMaxComponentsParameter() {
 List<Appender<Object>> appenderList = new ArrayList<Appender<Object>>();
 int max = 10;
 appenderTracker.setMaxComponents(max);
 for (int i = 0; i < (max + 1); i++) {
  Appender<Object> a = appenderTracker.getOrCreate(key + "-" + i, now++);
  appenderList.add(a);
 }
 // cleaning only happens in removeStaleComponents
 appenderTracker.removeStaleComponents(now++);
 assertEquals(max, appenderTracker.allKeys().size());
 assertNull(appenderTracker.find(key + "-" + 0));
 assertFalse(appenderList.get(0).isStarted());
}

代码示例来源:origin: tony19/logback-android

@Test
public void endOfLivedAppendersShouldBeRemovedAfterLingeringTimeout() {
 Appender<Object> a = appenderTracker.getOrCreate(key, now);
 appenderTracker.endOfLife(key);
 now += AppenderTracker.LINGERING_TIMEOUT + 1;
 appenderTracker.removeStaleComponents(now);
 assertFalse(a.isStarted());
 a = appenderTracker.find(key);
 assertNull(a);
}

相关文章