Serilog and
“Json logging as a charm”


And we’re back!

This week we released a new connector for the ever growing in popularity logging library Serilog.

Serilog is one of the sweetest logging libraries I have ever seen, even if my background is in Java.
So we developed, tested and released a sink that allows you to stream your events and logs straight to in Json.

If you want to try it, simply install the sink Serilog.Sinks.Logmatic via NuGet as usual, plus the new Serilog connector directly to your code.

/ Instantiate the logger
var log = new LoggerConfiguration()
    //.WriteTo.Whatever ...

// An example
var position = new { Latitude = 25, Longitude = 134 };
var elapsedMs = 34;
log.Information("Processed {@Position} in {Elapsed:000} ms.", position, elapsedMs); 

And the output looks like as:

    "MessageTemplate":"Processed {@Position} in {Elapsed:000} ms.",

And this is it: nothing else to do, just enjoy your metrics, logs and events.

I’ll leave you some links to dig deeper:


Have fun and keep on logging smiley

Related Posts

Get notified when new content is published