Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility between Serilog.Sinks.Seq 7.0.0 and Serilog.Sinks.Elasticsearch 9.0.3 #213

Closed
david-yaari opened this issue Mar 12, 2024 · 5 comments

Comments

@david-yaari
Copy link

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?

@nblumhardt
Copy link
Member

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.

@profet23
Copy link

profet23 commented Mar 14, 2024

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.

@nblumhardt
Copy link
Member

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

@profet23
Copy link

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.

@nblumhardt
Copy link
Member

This is also fixed in v7.0.1 of this sink

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants