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

Serilog upgrade >=3.0 causes exception to be thrown #17

Closed
dallasbeek opened this issue Apr 11, 2024 · 3 comments
Closed

Serilog upgrade >=3.0 causes exception to be thrown #17

dallasbeek opened this issue Apr 11, 2024 · 3 comments

Comments

@dallasbeek
Copy link

Status

BUG REPORT

Steps

Getting an exception likely caused by Serilog upgrade.

It looks like Serilog marked PeriodicBatchingSink class as sealed

public sealed class PeriodicBatchingSink : ILogEventSink, IDisposable

Actual behaviour

Unhandled exception. System.TypeLoadException: Could not load type 'Serilog.Sinks.NewRelic.Logs.NewRelicLogsSink' from assembly 'Serilog.Sinks.NewRelic.Logs, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null' because the parent type is sealed.
at Serilog.NewRelicLoggerConfigurationExtensions.NewRelicLogs(LoggerSinkConfiguration loggerSinkConfiguration, String endpointUrl, String applicationName, String licenseKey, String insertKey, LogEventLevel restrictedToMinimumLevel, Int32 batchSizeLimit, Nullable`1 period)

Environment

Running as Docker Image on Linux.

<PackageReference Include="Seq.Api" Version="2024.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Enrichers.AssemblyName" Version="2.0.0" />
<PackageReference Include="Serilog.Enrichers.CorrelationId" Version="3.0.1" />
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.3.0" />
<PackageReference Include="Serilog.Enrichers.MassTransit" Version="2.0.4" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.NewRelic.Logs" Version="1.2.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="7.0.0" />
@dallasbeek
Copy link
Author

more info here. Looks like an intentional change on their part :(

serilog/serilog-sinks-periodicbatching#74

@nblumhardt
Copy link

See also #16, which is the fix for this.

@dallasbeek
Copy link
Author

Confirm Fixed..ty

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

2 participants