Capture Serilog Data with Loupe

Serilog is a common, well-regarded Structured Logging API for .NET. It’s designed to help applications record well formatted log messages and name/value pairs to enable more advanced operations like filtering by the values recorded. It supports writing log data to multiple log storage systems ranging from simple text files to centralized logging systems.

Picture of Loupe Desktop Session Viewer with Serilog entries

Serilog provides several sophisticated features like filtering by severity level, custom formatting, and additional context information captured automatically for events.

Loupe integrates with Serilog by providing a custom Sink, capturing everything you’re already sending to Serilog, and extending it with Loupe’s additional data.

How the Loupe Agent works with Serilog

Loupe interfaces with Serilog through the Loupe Agent for Serilog. This allows it to work beside existing Sinks so that you can try Loupe in parallel with your existing log storage techniques. Adding Loupe to Serilog is easy - just add the correct NuGet package and one line of code to connect Loupe and Serilog.

  • Loupe.Serilog - For use with the .NET Framework version of the Loupe Agent (Gibraltar.Agent)
  • Loupe.Serilog.Core - For use with .NET Standard and .Net Core version of the Loupe Agent (Loupe.Agent.Core)

Once you’ve added the reference, register the Loupe sink like this:

var log = new LoggerConfiguration()
    .WriteTo.Loupe() //The call to .Loupe() is the only change

Or if you initialize Serilog through the host builder on .NET Core/.NET 5, it’s still just one line to add the Loupe sink:

Log.Logger = new LoggerConfiguration()
            .WriteTo.Loupe() //The call to .Loupe() is the only change

Like the Loupe Agent, the Loupe support for Serilog is open source on GitHub.

Centralized Logging, Live Logging, Error Management, and More

By adding Loupe with your existing application, all of the custom messages you’ve created will be merged with the additional data Loupe captures and can be viewed locally (even in real time) or sent to a Loupe Server for centralized storage and analysis.

Within minutes you can be getting notifications of each unique error reported in your application, with all the tools you need to manage those issues and support your users.

Rock solid centralized logging

Unlimited applications, unlimited errors, scalable from solo startup to enterprise.