Incompatibility between Serilog.Sinks.Seq 7.0.0 and Serilog.Sinks.Elasticsearch 9.0.3
david-yaari opened this issue ยท 5 comments
The above versions are the latest at the time of writing (12 Mar 2024).
If you reference in your project the latest version of Serilog.Sinks.Seq and Serilog.Sinks.Elasticsearch you get this runtime error:
System.TypeLoadException : Could not load type 'Serilog.Sinks.Elasticsearch.ElasticsearchSink' from assembly 'Serilog.Sinks.Elasticsearch, Version=9.0.3.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10' because the parent type is sealed.
It seems that the problem is in this:
- Serilog.Sinks.Seq 7.0.0 is referencing Serilog.Sinks.PeriodicBatching (>= 4.0.0) and
- Serilog.Sinks.Elasticsearch s referencing Serilog.Sinks.PeriodicBatching (>= 3.1.0)
As a workaround I downgraded Serilog.Sinks.Seq to version 6.0.0. (this version is using Serilog.Sinks.PeriodicBatching (>= 3.1.0))
I would like to use the latest version of Seq.
Can you fix this please?
The fix for this was merged in serilog-contrib/serilog-sinks-elasticsearch#579, I am not sure where the Elasticsearch sink preview releases are published but hopefully one will be on the way soon.
We are also seeing this with Serilog.Sinks.AwsCloudWatch
Unhandled exception. System.TypeLoadException: Could not load type 'Serilog.Sinks.AwsCloudWatch.CloudWatchLogSink' from assembly 'Serilog.Sinks.AwsCloudWatch, Version=4.0.182.0, Culture=neutral, PublicKeyToken=23b095b16108dcf5' because the parent type is sealed.
v10 of Serilog.Sinks.Elasticsearch is now published.
Hi @profet23 - is this the sink you're using? I can PR a fix over there if so: https://github.com/Cimpress-MCP/serilog-sinks-awscloudwatch
v10 of Serilog.Sinks.Elasticsearch is now published.
Hi @profet23 - is this the sink you're using? I can PR a fix over there if so: https://github.com/Cimpress-MCP/serilog-sinks-awscloudwatch
That's the one. Thank you.
This is also fixed in v7.0.1 of this sink