Monitoring

Monitoring and DevOps has gotten a lot of attantion the last years. There are now many open source projects out there offering logging, aggregation and metrics solutions.

Open Source Logging alternatives

Do not keep the logs on your server. They're worthless there!

ELK (Elasticsearch-Logstash-Kibana)

ELK Logos

A popular and widely used combination. We are not going to use the ELK stack in this version, but it's worth mentioning.

Graylog

Greylog Logo

Our sample dotNetCore app is going to use Graylog to log events.

Like the ELK stack, it uses Elasticsearch as its core component, but also relies on the MongoDB data store and the Apache Kafka messaging broker system.

Graylog uses a structured log format, so there is often no need to translate log entries into parameterized entries. If you are setting up a distributed logging system on an existing system, then you have Gelf formatters to help you out.

The Graylog Extended Log Format (GELF) is a log format that avoids the shortcomings of classic plain syslogs.

An example payload:

{
  "version": "1.1",
  "host": "example.org",
  "short_message": "A short message that helps you identify what is going on",
  "full_message": "Backtrace here\n\nmore stuff",
  "timestamp": 1385053862.3072,
  "level": 1,
  "_user_id": 9001,
  "_some_info": "foo",
  "_some_env_var": "bar"
}

To see how Serilog can be implemented, take a look at the sample app in /src/WebAppCore

Serilog

A structured logging framework for .Net. It's actually nice to use with Graylog (or any other log framework), since it has adapters to a lot of other formats.

Serilog Logo

Unlike other logging libraries, Serilog is built with powerful structured event data in mind.

To see how Serilog can be implemented, take a look at the sample app in /src/WebAppCore