At one of my clients, Seq is used as the main tool to store structured log messages. If you never heard about Seq before, on their website they promote Seq like this:
The self-hosted search, analysis, and alerting server built for structured logs and traces.
It certainly is a great tool, easy to use with a lot of great features. But hey, this post is not to promote Seq, I want to talk about a problem we encountered when using it.
A developer contacted me and shared the following screenshot:
Instead of the structured log message itself being logged, we got the error message above for a subset of our messages.
The problem was that the structured log message contained a large JSON object exceeding the default limit of 262144 bytes. Although you could wonder if it’s a good idea to log such large messages in general, for this specific use case it made sense.
So you can override the default for a specific application by setting the eventBodyLimitBytes
argument when configuring the Seq sink in Serilog:
It is also possible to change the default value on the Seq Server. Therefore go to Settings –> System and change the Raw event body limit: