Closed yehudamakarov closed 2 years ago
I'm observing the same behavior in an app that also uses Serilog.
@yehudamakarov , try adding preserveStaticLogger: true
inside UseSerilog
after the lambda as directed here. It fixed my issue using Oakton and Serilog together.
@yehudamakarov This sounds like the same issue as I had over on the Jasper repo. See my open issue: https://github.com/JasperFx/jasper/issues/668
I found a workaround (it's referenced in a comment on that item) that sounds like it will fix your issue.
I'm gonna tell y'all it's on Serilog. This only happens in combination with Serilog.
@flipdoubt LAte to the party here, but I'll add that to the Oakton docs when I update them next week
I finally added something to the docs today just pointing at the StackOverflow page w/ the workaround, will publish soon. Nothing actionable in Oakton itself here, this is really a Serilog issue.
The app runs, but request logging, etc. is not printing to the console. Only that first message before the Oakton function's call.
When I instead use:
All the logging takes place as expected. I have tried with and without the 2 stage logger initialization using the lambda: