Using Serilog

InvisionLog supports Serilog by providing its own 'sink' as a NuGet package.

Using Serilog and InvisionLog

Install the following NuGet package in your .NET Core application:

Install-Package Serilog.Sinks.InvisionLog

Our Serilog sink is made for .NET Core applicaions, so you also need to install the Serilog.AspNetCore package.

If you haven't done so already then first configure Serilog according to the official Serilog documentation. A good place to start is here.

Configure Serilog to use InvisionLog

The following highlighted part shows how to use InvisionLog with Serilog.


Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.InvisionLog(opts =>
{
    opts.StaticKey = "[Static key]";
    opts.ApplicationKey = "[Optional Application Key]";
})
.CreateLogger();