NLog logging target for InfluxDB v2.
.NET Core (NLog.Extensions.Logging package)
.NET Standard 2.x+ - NLog 4.5
Step 1: Install NLog.Targets.InfluxDB package from nuget.org
Install via Package-Manager Install-Package NLog.Targets.InfluxDB
Install via .NET CLI dotnet add package NLog.Targets.InfluxDB
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true">
<extensions>
<add assembly="NLog.Targets.InfluxDB"/>
</extensions>
<targets>
<target xsi:type="InfluxDB"
name="influx"
Host="https://yourinfluxhost.com"
Bucket="MyBucket"
Token="inFluXApi=K3y"
Org="Organisation"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="influx" />
</rules>
</nlog>
Param Name | Variable Type | Requirement | Description |
---|---|---|---|
Host | :string |
yes | InfluxDB Host |
Bucket | :string |
yes | InfluxDB Bucket |
Token | :string |
yes | InfluxDB API Token |
Org | :string |
yes | InfluxDB Organisation |
There is an example WPF application project NLog.Targets.InfluxDB.Demo
in the repo which demonstrates usage.