Centralize Microsoft.Extensions.Logging Data with Loupe

Loupe was designed to be the best way to record messages from Microsoft.Extensions.Logging in production; capturing everything you’re already sending to Log4Net and extending it with Loupe’s additional data.

How the Loupe Agent works with Microsoft.Extensions.Logging

Loupe has a Logging Provider that records messages as calls are made to Microsoft.Extensions.Logging. Adding the Loupe Provider means anything written not just by your application but also by other libraries and the .NET Core frameworks (like ASP.NET Core and Entity Framework Core) will also be captured.

To use the Loupe Logging Provider:

  1. Add the Loupe.Extensions.Logging NuGet Package to your project. This adds the provider itself and other required Loupe packages.

  2. Register the Loupe provider in your logging configuration

For projects that use Generic Host (like ASP.NET Core), just add a call to AddLoupe like this:

public static IHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .ConfigureLogging(builder =>
            {
                //this line adds Loupe to the configuration builder
                builder.AddLoupe();
            })
            .UseStartup<Startup>();

In a non-host app (like a console application) make the call while creating your LoggerFactory, like this:

//Create a logging factory, typically once per application.
var loggerFactory = LoggerFactory.Create(builder =>
{
    builder
        .AddFilter("Microsoft", LogLevel.Warning)
        .AddFilter("System", LogLevel.Warning)
        .AddFilter("LoggingConsoleApp.Program", LogLevel.Debug)
        .AddLoupe(); //thos line adds Loupe
});

//Having set up the factory, use it to create the logger for your class
ILogger logger = loggerFactory.CreateLogger<Program>();
logger.LogInformation("This message will be sent to Loupe (and any other logging provider you configure above)");

Centralized Logging, Error Management, and More

By adding Loupe with your existing .NET Core application, all of the custom messages you’ve created will be merged with the additional data Loupe captures and can be viewed locally 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.