pada57 / serilog-sinks-influxdb

Serilog Sinks for InfluxDB
MIT License
10 stars 9 forks source link

Don't work with InfluxDB.Client 1.18.0 #11

Closed drsmile1001 closed 2 years ago

drsmile1001 commented 3 years ago

I use InfluxDB.Client 1.18.0 on my main project, It seens have some compatibility issues.

It can be reproduce by changing the refenerce of your sample project "Serilog.Sinks.InfluxDB.Console.AppSettings" to

<ItemGroup>
    <PackageReference Include="InfluxDB.Client" Version="1.18.0" />
...
</ItemGroup>

And It will end by loging

2021-05-04T01:54:11.2709182Z Exception while emitting periodic batch from Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink: System.MissingMethodException: Method not found: 'InfluxDB.Client.WriteApiAsync InfluxDB.Client.InfluxDBClient.GetWriteApiAsync()'.
   at Serilog.Sinks.InfluxDB.InfluxDBSink.EmitBatchAsync(IEnumerable`1 batch)
   at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()
pada57 commented 3 years ago

Hello @drsmile1001

Yes indeed that's why those package are set as dependencies on nuget.org

InfluxDB.Client (>= 1.16.0) Serilog (>= 2.10.0) Serilog.Sinks.PeriodicBatching (>= 2.3.0)

Why do you need old version as it comes as dependencies? You can use older nugget version which use not async version of it helps.

https://www.nuget.org/packages/Serilog.Sinks.InfluxDB.Syslog/1.2.0

drsmile1001 commented 3 years ago

I think 1.18.0 >= 1.16.0 ...? https://www.nuget.org/packages/InfluxDB.Client/1.18.0 https://www.nuget.org/packages/InfluxDB.Client/1.16.0

pada57 commented 3 years ago

Sorry I should have write newer version instead of old. maybe signature of writeasync method has changed in new version need to check. You cannot use 1.6 ?

drsmile1001 commented 3 years ago

OK, I will try that.