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

Broken with Serilog v3 #14

Open
lol768 opened this issue Nov 16, 2023 · 7 comments · May be fixed by #15
Open

Broken with Serilog v3 #14

lol768 opened this issue Nov 16, 2023 · 7 comments · May be fixed by #15

Comments

@lol768
Copy link

lol768 commented Nov 16, 2023

System.MissingMethodException: Method not found: 'Void Serilog.Parsing.TextToken..ctor(System.String, Int32)'.

Culprit: this change

@lol768 lol768 linked a pull request Nov 20, 2023 that will close this issue
@abelbraaksma
Copy link

abelbraaksma commented Aug 11, 2024

Just confirming that in my project, after moving to .NET 8.0 and upgrading Serilog, I'm seeing the same issue using Redbox.Serilog.Stackdriver.

webhost-1  | 2024-08-11T17:11:55.0023162Z Caught exception while emitting to sink Serilog.Sinks.SystemConsole.ConsoleSink: System.MissingMethodException: Method not found: 'Void Serilog.Parsing.TextToken..ctor(System.String, Int32)'.
webhost-1  |    at Redbox.Serilog.Stackdriver.StackdriverJsonFormatter.FormatEvent(LogEvent logEvent, TextWriter originalOutput, JsonValueFormatter valueFormatter)
webhost-1  |    at Redbox.Serilog.Stackdriver.StackdriverJsonFormatter.Format(LogEvent logEvent, TextWriter output)
webhost-1  |    at Serilog.Sinks.SystemConsole.ConsoleSink.Emit(LogEvent logEvent)
webhost-1  |    at Serilog.Core.Sinks.SafeAggregateSink.Emit(LogEvent logEvent)

I'm unsure what dependency of all the Serilog dlls this comes from (I first thought Serilog.Sinks.Console). I've updated everything to the latest stable (v4.x Serilog), but this is clearly still happening in Serilog v4.0....

Basically: console logging cannot be used with Serilog anymore since version 3? Anybody aware of a workaround?

@lol768
Copy link
Author

lol768 commented Aug 11, 2024

@abelbraaksma
Copy link

Oh, awesome!!! I'm gonna give it a try 🙏

@abelbraaksma
Copy link

@lol768, unfortunately, it didn't work. The same error is still there. I tried downgrading the Serilog assembly, but that had no effect either.

@abelbraaksma
Copy link

abelbraaksma commented Aug 11, 2024

wait. It still shows Redbox.Serilog.Stackdriver (as opposed to Raileasy.Serilog.Stackdriver in the stacktrace). I think I have a cached dependency or something. The transient dependency was not resolved properly. Weird. Ok, continuing research.... lol

@lol768
Copy link
Author

lol768 commented Aug 11, 2024

I was gonna say: that is odd, we're using Serilog (albeit 3.1.1) and that particular package (v1.2.2) with .NET 8 in production today. Package shenanigans might explain it, but do shout if you continue to have issues

@abelbraaksma
Copy link

abelbraaksma commented Aug 11, 2024

Yeah, my bad. I used docker-compose up and forgot to do a rebuild with docker-compose build --no-cache.

The same issue did not occur when running directly, hence the caching issue. It works!!!! 🪂

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

Successfully merging a pull request may close this issue.

2 participants