Serilog.Sinks.Raygun 8.2.0

serilog-sinks-raygun

Serilog Sinks error and performance monitoring with Raygun is available using the serilog-sinks-raygun provider.

serilog-sinks-raygun is a library that you can easily add to your website or web application, which will then monitor your application and display all Serilog errors and issues affecting your users within your Raygun account. Installation is painless.

The provider is a single package (Serilog.Sinks.Raygun) which includes the sole dependency (Serilog), allowing you to drop it straight in.

Getting started

Step 1 - Add packages

Install the Serilog (if not included already) and Serilog.Sinks.Raygun package into your project. You can either use the below dotnet CLI command, or the NuGet management GUI in the IDE you use.

 dotnet add package Serilog
 dotnet add package Serilog.Sinks.Raygun

Step 2 - Initialization

The following examples are for .NET 6.0+ applications. For other frameworks, please refer to the .NET Framework Readme.

Example of setup for ASP.NET Applications:

using Mindscape.Raygun4Net.AspNetCore;
using Serilog;

var builder = WebApplication.CreateBuilder(args);

// Add Raygun
builder.Services.AddRaygun(builder.Configuration);
builder.Services.AddRaygunUserProvider();

builder.Host.UseSerilog((context, provider, config) =>
{
    // Add the Raygun sink
    config.WriteTo.Raygun(raygunClient: provider.GetRequiredService<RaygunClient>());
});

Example of setup for Console/Service:

using Mindscape.Raygun4Net;
using Serilog;
using Serilog.Sinks.Raygun.Extensions;

var host = Host.CreateDefaultBuilder(args)
    .ConfigureServices((context, services) =>
    {
        // Add Raygun
        services.AddRaygun(context.Configuration);
        services.AddHostedService<Worker>();
    })
    .UseSerilog((_, serviceProvider, config) =>
    {
        // Add the Raygun sink
        config.WriteTo.Raygun(raygunClient: serviceProvider.GetRequiredService<RaygunClient>());
    })
    .Build();

await host.RunAsync();

Example of setup for MAUI:

using Serilog;

var builder = MauiApp.CreateBuilder();

builder
    .UseMauiApp<App>()

    // Add Raygun
    .AddRaygun();

var app = builder.Build();

Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Debug()

    // Add the Raygun sink
    .WriteTo.Raygun(raygunClient: app.Services.GetRequiredService<RaygunMauiClient>())
    .CreateLogger();

return app;

Configuration Properties

raygunClient

type: RaygunClientBase

required

This property is required for the Raygun Sink to function. The client can be any implementation that inherits from RaygunClientBase, this could be the Raygun4Maui client, Raygun4Net.AspNetCore client, or Raygun4Net.NetCore client. Ideally, this is resolved from the ServiceCollection in .NET Core applications.

formatProvider

type: IFormatProvider

default: null

This property supplies culture-specific formatting information. By default, it is null.

restrictedToMinimumLevel

type: LogEventLevel

default: LogEventLevel.Error

You can set the minimum log event level required in order to write an event to the sink. By default, this is set to Error as Raygun is mostly used for error reporting.


Enrich with HTTP request and response data

Properties included from other Serilog Enrichers should automatically be included into the Raygun errors.

To use the old Raygun Enricher you can follow the Enricher Readme to add the enricher to your project.

Showing the top 20 packages that depend on Serilog.Sinks.Raygun.

Packages Downloads
Loring.Logging
A propriatry logging library for Loring's products
142
Loring.Logging
A propriatry logging library for Loring's products
102
Loring.Logging
A propriatry logging library for Loring's products
51
twLogging
A propriatry logging library for Tipwinns's products
32
Loring.Logging
Package Description
23
Loring.Logging
Package Description
22
twLogging
A propriatry logging library for Tipwinns's products
21
twLogging
Package Description
12
Loring.Logging
A propriatry logging library for Loring's products
9
Loring.Logging
A propriatry logging library for Loring's products
8
twLogging
A propriatry logging library for Tipwinns's products
7
Loring.Logging
A propriatry logging library for Loring's products
7
Loring.Logging
Package Description
6
Loring.Logging
A propriatry logging library for Loring's products
6
twLogging
A propriatry logging library for Tipwinns's products
6
Loring.Logging
Package Description
5
twLogging
A propriatry logging library for Tipwinns's products
5
Loring.Logging
A propriatry logging library for Loring's products
5

https://github.com/MindscapeHQ/serilog-sinks-raygun/blob/master/CHANGE-LOG.md

Version Downloads Last updated
8.2.0 2 08/24/2025
8.2.0-pre-1 2 08/25/2025
8.1.0-pre-1 2 08/25/2025
8.0.0 21 12/27/2024
7.6.0-pre-1 2 08/25/2025
7.5.0 28 08/23/2025
7.5.0-pre-1 2 08/25/2025
7.4.0 2 08/24/2025
7.4.0-pre-1 2 08/25/2025
7.3.0 2 08/24/2025
7.3.0-pre-2 2 08/25/2025
7.3.0-pre-1 2 08/25/2025
7.2.0-pre-1 2 08/25/2025
7.1.0 2 08/24/2025
7.0.0 2 08/24/2025
7.0.0-pre-2 2 08/25/2025
7.0.0-pre-1 2 08/25/2025
5.3.3 2 08/24/2025
5.3.1 2 08/24/2025
5.3.0 2 08/24/2025
5.2.0 2 08/24/2025
5.1.1 2 08/24/2025
5.1.1-dev-00108 2 08/25/2025
5.1.1-dev-00107 2 08/25/2025
5.1.0 2 08/24/2025
5.1.0-dev-00102 2 08/25/2025
5.0.3-dev-00101 2 08/25/2025
5.0.3-dev-00097 2 08/25/2025
5.0.3-dev-00089 2 08/25/2025
5.0.2 2 08/24/2025
5.0.2-dev-00086 2 08/25/2025
5.0.2-dev-00083 2 08/25/2025
5.0.1 2 08/24/2025
5.0.1-dev-00074 2 08/25/2025
5.0.0 2 08/24/2025
4.0.1-dev-00070 2 08/25/2025
4.0.1-dev-00056 2 08/25/2025
4.0.1-dev-00048 2 08/25/2025
4.0.1-dev-00045 2 08/24/2025
4.0.1-dev-00040 2 08/25/2025
4.0.1-dev-00039 2 08/25/2025
4.0.1-dev-00038 2 08/25/2025
4.0.0 2 08/24/2025
4.0.0-dev-00029 2 08/25/2025
3.0.1-dev-00026 2 08/25/2025
3.0.1-dev-00024 2 08/25/2025
3.0.1-dev-00022 2 08/25/2025
3.0.1-dev-00021 2 08/25/2025
3.0.0 2 08/24/2025
2.0.15 2 08/24/2025
2.0.13 2 08/24/2025
1.5.10 2 08/24/2025
1.5.8 2 08/24/2025
1.5.6 2 08/24/2025
1.5.3 2 08/24/2025
1.5.2 2 08/24/2025
1.5.1 2 08/23/2025
1.4.196 2 08/24/2025
1.4.182 2 08/24/2025
1.4.168 2 08/24/2025
1.4.155 2 08/24/2025
1.4.139 2 08/24/2025
1.4.118 2 08/24/2025
1.4.113 2 08/24/2025
1.4.102 2 08/24/2025
1.4.99 2 08/24/2025
1.4.97 2 08/24/2025
1.4.76 2 08/24/2025
1.4.39 2 08/24/2025
1.4.34 2 08/24/2025
1.4.28 2 08/24/2025
1.4.27 2 08/24/2025
1.4.23 2 08/24/2025
1.4.21 2 08/24/2025
1.4.18 2 08/24/2025
1.4.15 0 11/04/2014
1.4.14 0 10/23/2014
1.4.13 0 10/23/2014
1.4.12 0 10/12/2014
1.4.11 0 10/08/2014
1.4.10 0 09/26/2014
1.4.9 0 09/17/2014
1.4.8 0 09/11/2014
1.4.7 0 09/01/2014
1.4.6 0 08/31/2014
1.4.5 0 08/27/2014
1.4.4 0 08/27/2014
1.4.3 0 08/25/2014
1.4.2 0 08/23/2014
1.4.1 0 08/23/2014
1.3.43 0 08/04/2014
1.3.42 0 07/30/2014
1.3.41 0 07/28/2014
1.3.40 0 07/26/2014
1.3.39 0 07/25/2014
1.3.36 0 07/20/2014
1.3.35 0 07/17/2014
1.3.34 0 07/06/2014
1.3.33 0 06/30/2014
1.3.30 0 06/19/2014
1.3.29 0 06/19/2014
1.3.28 0 06/19/2014
1.3.27 0 06/18/2014
1.3.25 0 06/09/2014
1.3.24 0 05/21/2014
1.3.23 0 05/20/2014
1.3.20 0 05/18/2014
1.3.19 0 05/17/2014
1.3.18 0 05/17/2014
1.3.17 0 05/17/2014
1.3.16 0 05/17/2014
1.3.15 0 05/16/2014
1.3.14 0 05/16/2014
1.3.13 0 05/16/2014
1.3.12 0 05/14/2014