NET之NLOG使用

安装
Install-Package NLog.Config
配置文件

  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
      autoReload="true"
      throwExceptions="false"
      internalLogLevel="Trace" internalLogToConsole="false" internalLogFile="nlog-internal.log">
  <targets  async="true">
    <target name="logfile" xsi:type="File" fileName="file.txt" />
    <target name="logconsole" xsi:type="Console" />
  </targets>
  <rules>
    <logger name="*" minlevel="Info" writeTo="logconsole,logfile" />
    <logger name="*" minlevel="Debug" writeTo="logconsole" />
    <logger name="*" minlevel="Error" writeTo="logconsole,logfile" />
  </rules>
</nlog>  

使用
public static readonly NLog.Logger Logger = NLog.LogManager.GetCurrentClassLogger();
Logger.Error("Error" + (e.Source as AccordionStyleControl).Tag.ToString());

时序数据库InfluxDB在centos7安装使用

安装过程:
curl -O https://dl.influxdata.com/influxdb/releases/influxdb-1.7.7.x86_64.rpm
yum install influxdb-1.7.7.x86_64.rpm
systemctl start influxdb
systemctl status influxdb
配置安全选项
vim /etc/influxdb/influxdb.conf
[http]
enabled = true
bind-address = “:8086”
auth-enabled = true
log-enabled = true
https暂不开启
登录
influx -precision rfc3339
有密码登录
influx -precision rfc3339 -username ‘admin’ -password ‘admin’
设置密码(必须登录,先停止安全配置,重启influxdb)
CREATE USER admin WITH PASSWORD ‘‘ WITH ALL PRIVILEGES
数据库连接使用
NET:https://github.com/influxdata/influxdb-java
java:https://github.com/AdysTech/InfluxDB.Client.Net