serilog-sinks-testcorrelator
serilog-sinks-testcorrelator copied to clipboard
Stop storing uncorrelated `LogEvent`s.
We should not store log events without any correlating context. These events are unrecoverable anyways.
@ahahn95
I'm running into a situation where I'm writing an integration test on .NET Core 3.1 and the AsyncLocal<> is not working (logging in a thread started by NServiceBus). It was nice to see the log events stored without the context in the debugger. I could see that logging was working, but the "magic" wasn't. Maybe store them with a Guid.Empty?
As a quick and dirty way to get over my AsyncLocal<> problem, I'm halfway tempted to call the method on the private static class LogicalCallContext.Add
to add the value in the place where I am writing to a log. But it would be nice if there was an alternate mechanism that didn't rely on thread storage. Perhaps a special property added to a log entry?