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

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

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

Appender.addWarn介绍

暂无

代码示例

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

@Override
public void addWarn(String msg, Throwable ex) {
 delegate.addWarn(msg, ex);
}

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

@Override
public void addWarn(String msg) {
 delegate.addWarn(msg);
}

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

@Override
public void addWarn(String msg, Throwable ex) {
 delegate.addWarn(msg, ex);
}

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

@Override
public void addWarn(String msg) {
 delegate.addWarn(msg);
}

代码示例来源:origin: co.wrisk.logback/logback-ext-core

public static void awaitLatch(Appender<?> appender, CountDownLatch latch, long waitMillis) {
  if (latch.getCount() > 0) {
    try {
      boolean completed = latch.await(waitMillis, TimeUnit.MILLISECONDS);
      if (!completed) {
        appender.addWarn(format("Appender '%s' did not complete sending event in %d milliseconds, " +
                    "the event might have been lost",
                    appender.getName(), waitMillis));
      }
    } catch (InterruptedException ex) {
      appender.addWarn(format("Appender '%s' was interrupted, " +
                  "a logging event might have been lost or shutdown was initiated",
                  appender.getName()));
      Thread.currentThread().interrupt();
    }
  }
}

代码示例来源:origin: co.wrisk.logback/logback-ext-core

public static void shutdown(Appender<?> appender, ExecutorService executor, long waitMillis) {
  executor.shutdown();
  boolean completed = awaitTermination(appender, executor, waitMillis);
  if (!completed) {
    appender.addWarn(format("Executor for %s did not shut down in %d milliseconds, " +
                "logging events might have been discarded",
                appender.getName(), waitMillis));
  }
}

相关文章