Last week a collegae mentionted he had some problems with Serilog, a structured logging library for .NET. Most of the time it just worked fine, but he noticed that in some situations no log messages were written to a sink. We first thought it had something to do with misconfigured log levels but that turned out to be a wrong assumption.
In the end, we found the root cause after enabling the Serilog debug log:
After doing that, we discovered that in some cases the following message was logged:
Maximum destructuring depth reached.
Due to a recursive object in one of our log messages, the JSON serializer gives up and Serilog discards the message.