talira

Simple .NET logging with fully structured events

open sourceApache-2.0free

Serilog is a diagnostic logging library for .NET that records structured event data. Message templates (named placeholders such as {Elapsed}) capture each value as a property instead of only formatting text, so events can be written as JSON and searched by property in back-ends that store structured logs, while files and the console still get readable text. Sinks send events to files, the console and many other outputs (Seq, Elasticsearch, cloud logging services), and packages integrate it with ASP.NET Core, Microsoft.Extensions.Logging, the .NET generic host and configuration files.

Problems it solves

  • structured logging for my ASP.NET Core app
  • log JSON events from .NET that I can search by property
  • write .NET logs to a file and the console with rolling files
  • send my C# app's logs to Seq or Elasticsearch

Features

  • structured events from message templates
  • sinks for files, the console and many other outputs
  • ASP.NET Core, Microsoft.Extensions.Logging and generic host integration
  • configuration from appsettings.json
  • compact JSON formatting

Capabilities

Takes pluginsplan not known

Alternatives

The same job

These do what Serilog does.

  1. Apache log4net A logging library for .NET

Compare Serilog with the top 3