org.influxdb.InfluxDB.setLogLevel()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(322)

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

InfluxDB.setLogLevel介绍

[英]Set the loglevel which is used for REST related actions.
[中]设置用于REST相关操作的日志级别。

代码示例

代码示例来源:origin: tzolov/geode-dashboard

@Bean
public InfluxDB influxDB(
    @Value("${influxUrl}") String influxUrl,
    @Value("${influxUser}") String influxUser,
    @Value("${influxPassword}") String influxPassword) {
  InfluxDB influxDB = InfluxDBFactory.connect(influxUrl, influxUser, influxPassword);
  influxDB.setLogLevel(LogLevel.NONE);
  return influxDB;
}

代码示例来源:origin: tzolov/geode-dashboard

@Bean
public InfluxDB influxDB(
    @Value("${influxUrl}") String influxUrl,
    @Value("${influxUser}") String influxUser,
    @Value("${influxPassword}") String influxPassword) {
  InfluxDB influxDB = InfluxDBFactory.connect(influxUrl, influxUser, influxPassword);
  influxDB.setLogLevel(LogLevel.NONE);
  return influxDB;
}

代码示例来源:origin: org.apereo.cas/cas-server-support-influxdb-core

public InfluxDbConnectionFactory(final String url, final String uid,
                 final String psw, final String dbName,
                 final boolean dropDatabase) {
  if (StringUtils.isBlank(dbName) || StringUtils.isBlank(url)) {
    throw new IllegalArgumentException("Database name/url cannot be blank and must be specified");
  }
  val builder = new OkHttpClient.Builder();
  this.influxDb = InfluxDBFactory.connect(url, uid, psw, builder);
  this.influxDb.enableGzip();
  if (dropDatabase) {
    this.influxDb.deleteDatabase(dbName);
  }
  if (!this.influxDb.databaseExists(dbName)) {
    this.influxDb.createDatabase(dbName);
  }
  this.influxDb.setLogLevel(InfluxDB.LogLevel.NONE);
  if (LOGGER.isDebugEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.FULL);
  } else if (LOGGER.isInfoEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.BASIC);
  } else if (LOGGER.isWarnEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.HEADERS);
  } else if (LOGGER.isErrorEnabled()) {
    this.influxDb.setLogLevel(InfluxDB.LogLevel.NONE);
  }
}

代码示例来源:origin: com.remondis.limbus/limbus-monitoring-influx

@Override
protected void performInitialize() throws Exception {
 super.performInitialize();
 PublisherUtils.denyRequired("databaseUrl", databaseUrl);
 PublisherUtils.denyRequired("username", username);
 PublisherUtils.denyRequired("password", password);
 PublisherUtils.denyRequired("database", database);
 Lang.defaultIfNull(retentionPolicy, "default");
 influxDB = InfluxDBFactory.connect(databaseUrl, username, password);
 influxDB.enableBatch(2000, 1000, TimeUnit.MILLISECONDS);
 influxDB.setLogLevel(LogLevel.NONE);
}

代码示例来源:origin: sitewhere/sitewhere

@Override
public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException {
super.start(monitor);
String connectionUrl = "http://" + getHostname().getValue() + ":" + getConfiguration().getPort();
this.influx = InfluxDBFactory.connect(connectionUrl, getConfiguration().getUsername(),
  getConfiguration().getPassword());
influx.createDatabase(getDatabase().getValue());
if (getConfiguration().isEnableBatch()) {
  influx.enableBatch(getConfiguration().getBatchChunkSize(), getConfiguration().getBatchIntervalMs(),
    TimeUnit.MILLISECONDS);
}
influx.setLogLevel(convertLogLevel(getConfiguration().getLogLevel()));
}

相关文章