akka-meta icon indicating copy to clipboard operation
akka-meta copied to clipboard

Semantic Logging in Akka Core

Open rogeralsing opened this issue 9 years ago • 1 comments

The current logging infrastructure in Akka is based on logging strings. Which works fine for oldschool loggers like NLog (on .NET that is)

But there are a lot of valuable information in those logs that is hard to get from a pure textual log. For example, lets say you want to measure frequency of heartbeats, or how often some system is gated etc. You would have to parse text output for that.

(I know you are also working on monitoring support which might make some of these things easier)

But if the logging infrastructure inside Akka core modules used semantic logging. we could extract much more useful information about the system.

e.g. Akka logs -> elastic search -> kibana dashboard.

I think that would be a very nice addition to any type of monitoring support.

We on the .NET side do support semantic logging via Serilog as a logging adapter. however, that requires other type of formats/templates for your actual log messages. So it is absolutely possible to use semantic logging in user code of Akka.NET.

But inside the core modules, we still have the standard string formatted messages + LogEvent derivates that simply outputs its content via ToString()

Thoughts on this?

rogeralsing avatar Jun 12 '15 10:06 rogeralsing

The way that we've handled this in the past is to use the logstash-logback-encoder with JSON composite layout

https://github.com/logstash/logstash-logback-encoder#composite-encoderlayout

and then set up a context through use of LogstashMarkers that get dropped in as JSON attributes.

wsargent avatar Jun 04 '18 17:06 wsargent