Skip to content

Data Analysis

Closing the Feedback Loop from Log Messages to Knowledge

In the last few weeks I posted a series of articles on log messages. Starting at the missed opportunities, continued with the great power of structured logging with Serilog and different sinks to the helpful dashboard of Kibana. With that entire infrastructure in place we are now able to turn log messages into knowledge. And even better, this doesn’t have to be one-time action.

Elasticsearch as a Sink for Serilog

When multiple systems continuously produce log messages they accumulate quickly. In combination with a longer retention time we easily talk about millions of log messages that need to be stored and searched. A single System like Seq will reach its limits and we need a bigger, more scalable solution.

Debugging With Serilog

When you play with different configurations for Serilog or try to add another sink you may run into problems. If you are out of luck your application crashes without the slightest notice - Serilog silently eats it's own errors. In such cases you have to dig a little deeper into Serilog to find out what’s going on.

How to Influence the Output of Serilog

Serilog is a great tool to write structured log messages. To fully profit from the structured part you need to write your log messages in a certain way. Otherwise you lose most of the great features and could use any other traditional logging framework. Luckily there are only a few simple things you should keep in mind and I will show you today what those are.

Seq as a Sink for Serilog

As I explained in the last posts, log messages are not just strings but have an inner meaning. When we use Serilog to write structured log messages we make them explicit to query them later. The tool we want to use to search for a specific orderId should give us this capability without the need to write all the code from scratch. We therefore need a tool that understands log messages and, if possible, even Serilog. One such tool is Seq that I explain in this blog post.

Structured Logging with Serilog

As a .Net developer you can choose from a variety of logging frameworks. All are more or less built to mitigate the shortcomings of the built in tracing framework. While System.Diagnostics.Trace has some helpful concepts, it misses many basic features most other logging frameworks can offer out of the box.