Skip to content

Instantly share code, notes, and snippets.

@bleroy
Last active October 31, 2016 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleroy/c6b14432fdf83cd26dcf7104c49da055 to your computer and use it in GitHub Desktop.
Save bleroy/c6b14432fdf83cd26dcf7104c49da055 to your computer and use it in GitHub Desktop.
Tips for the Week in .NET

Please comment below...

.NET

Package of the week: Serilog

Modern applications can be complex, busy, asynchronous and distributed. This adds up to make understanding behavior and finding bugs a significant challenge. While tools for monitoring and debugging apps are always improving, Serilog helps by capturing log data in a form that's substantially easier for tooling to work with.

On the surface, Serilog looks like most logging libraries:

Log.Information("Request completed in {Elapsed} ms", sw.ElapsedMilliseconds);

While messages can be formatted into text, Serilog uses named placeholders to capture and preserve parameters like Elapsed as first-class event properties:

{"@t":"2016-06-07T03:44:57.853Z","@m":"Request completed in 18 ms","Elapsed":18}

Many of the Serilog sinks accept data in structured formats like JSON, so searches like Elapsed > 10 can be answered directly, without the need for regular expressions or log parsing.

Serilog is built from the ground up for distributed logging, and comes with a rich set of features for grouping, enriching and correlating log events. The project is open source and developed by a dedicated community on GitHub.

@cmendible
Copy link

Hi guys here is my new post: Step by step: Scale ASP.NET Core with Docker Swarm

Cheers!

@andrewlock
Copy link

Hi, I wrote a couple of posts this week:

Thanks as always for the great roundup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment