Chat Support
Loupe - Log - Monitor - Resolve
Loupe / Developer's Guide / For .NET Core / 6 / 8 / Logging / Using with Other Log Systems / Third Party Integration - Using Serilog with Loupe
In This Topic
    Third Party Integration - Using Serilog with Loupe
    In This Topic

    Serilog is a popular logging system specialized in Structured Logging - a logging approach that records named data structures along with log messages to make it easy to drill into the details without creating over-long log messages. It's great in modern applications to store additional context along with key log messages.

    Loupe provides a Sink for Serilog to capture all of the log messages it publishes and map them into Loupe, putting them in context with the rest of the diagnostic information recorded by Loupe. The Loupe Agent for Serilog is published to NuGet, making it easy to add to your application. To get started, add the NuGet package:

    This agent is open source and hosted on GitHub. If you'd like to see it do something more/better/different or just curious how it works you can get the entire source code and even give the team a pull request or just log an issue.

    Once you've added the NuGet package, register the Loupe sink like this:

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

    Of course, you may have more calls after LoggerConfiguration() to customize your Serilog configuration. Typically the .WriteTo calls are near the end of the configuration and just before CreateLogger.

    This library is fully supported by Gibraltar Software. If you run into any issues using it, please don't hesitate to contact us at support@onloupe.com.
    See Also