org.apache.dubbo.common.logger.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(236)

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

Logger.warn介绍

[英]Logs a message with warn log level.
[中]记录具有警告日志级别的消息。

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public void warn(Throwable e) {
  try {
    logger.warn(e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: apache/incubator-dubbo

public void close() {
  try {
    if (executor != null) {
      executor.shutdown();
    }
  } catch (Throwable t) {
    logger.warn("fail to destroy thread pool of server: " + t.getMessage(), t);
  }
}

代码示例来源:origin: apache/incubator-dubbo

/**
 * If {@link #REQUEST_WITH_WARNING_KEY} is configured, then warn once every 5000 invocations.
 */
private void warning() {
  if (requestWithWarning) {
    if (warningcount.get() % warning_period == 0) {
      logger.warn(new IllegalStateException("safe guard client , should not be called ,must have a bug."));
    }
    warningcount.incrementAndGet();
  }
}

代码示例来源:origin: apache/incubator-dubbo

/**
 * If {@link #REQUEST_WITH_WARNING_KEY} is configured, then warn once every 5000 invocations.
 */
private void warning() {
  if (requestWithWarning) {
    if (warningcount.get() % warning_period == 0) {
      logger.warn(new IllegalStateException("safe guard client , should not be called ,must have a bug."));
    }
    warningcount.incrementAndGet();
  }
}

代码示例来源:origin: apache/incubator-dubbo

private void checkQueueLength() {
    if (connectionExecutor.getQueue().size() > queuewarninglimit) {
      logger.warn(new IllegalThreadStateException("connectionordered channel handler `queue size: " + connectionExecutor.getQueue().size() + " exceed the warning limit number :" + queuewarninglimit));
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
protected void doClose() throws Throwable {
  try {
    transport.stop();
  } catch (Throwable e) {
    logger.warn(e.getMessage(), e);
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
protected void doDisConnect() throws Throwable {
  try {
    NettyChannel.removeChannelIfDisconnected(channel);
  } catch (Throwable t) {
    logger.warn(t.getMessage());
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public void close() {
  if (closed) {
    return;
  }
  closed = true;
  try {
    doClose();
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
  public void run() {
    try {
      rmiServiceExporter.destroy();
    } catch (Throwable e) {
      logger.warn(e.getMessage(), e);
    }
  }
};

代码示例来源:origin: apache/incubator-dubbo

@Override
protected void doDisConnect() throws Throwable {
  try {
    MinaChannel.removeChannelIfDisconnected(session);
  } catch (Throwable t) {
    logger.warn(t.getMessage());
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
  public void run() {
    try {
      rmiServiceExporter.destroy();
    } catch (Throwable e) {
      logger.warn(e.getMessage(), e);
    }
  }
};

代码示例来源:origin: apache/incubator-dubbo

public static void warn(Logger logger, String msg, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(msg, e);
  }
}

代码示例来源:origin: apache/incubator-dubbo

public static void warn(Logger logger, String msg) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(msg);
  }
}

代码示例来源:origin: apache/incubator-dubbo

public static void warn(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(e);
  }
}

代码示例来源:origin: apache/incubator-dubbo

public void expire() {
  if (!compareAndSetState(ST_INIT, ST_EXPIRED)) {
    return;
  }
  try {
    task.run(this);
  } catch (Throwable t) {
    if (logger.isWarnEnabled()) {
      logger.warn("An exception was thrown by " + TimerTask.class.getSimpleName() + '.', t);
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
  Set<String> resolvedPackagesToScan = resolvePackagesToScan(packagesToScan);
  if (!CollectionUtils.isEmpty(resolvedPackagesToScan)) {
    registerServiceBeans(resolvedPackagesToScan, registry);
  } else {
    if (logger.isWarnEnabled()) {
      logger.warn("packagesToScan is empty , ServiceBean registry will be ignored!");
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
  Set<String> resolvedPackagesToScan = resolvePackagesToScan(packagesToScan);
  if (!CollectionUtils.isEmpty(resolvedPackagesToScan)) {
    registerServiceBeans(resolvedPackagesToScan, registry);
  } else {
    if (logger.isWarnEnabled()) {
      logger.warn("packagesToScan is empty , ServiceBean registry will be ignored!");
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

public void expire() {
  if (!compareAndSetState(ST_INIT, ST_EXPIRED)) {
    return;
  }
  try {
    task.run(this);
  } catch (Throwable t) {
    if (logger.isWarnEnabled()) {
      logger.warn("An exception was thrown by " + TimerTask.class.getSimpleName() + '.', t);
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
  public void close() {
    super.close();

    ServletManager.getInstance().removeServletContext(url.getPort());

    try {
      tomcat.stop();
    } catch (Exception e) {
      logger.warn(e.getMessage(), e);
    }
  }
}

代码示例来源:origin: apache/incubator-dubbo

protected void checkMetadataReport() {
  // TODO get from ConfigManager first, only create if absent.
  if (metadataReportConfig == null) {
    setMetadataReportConfig(new MetadataReportConfig());
  }
  metadataReportConfig.refresh();
  if (!metadataReportConfig.isValid()) {
    logger.warn("There's no valid metadata config found, if you are using the simplified mode of registry url, " +
        "please make sure you have a metadata address configured properly.");
  }
}

相关文章