Skip to content
Table of contents

Serilog.Sinks.SentrySDK: Adapting log events to Sentry

Serilog.Sinks.SentrySDK connects a .NET logging pipeline to the Sentry SDK. Its sink converts structured log events for Sentry, so application call sites can keep using Serilog.

Library
  • Updated
  • 2
  • C# · 98.04%
  • MIT
Documented components
2Explore modules
Source documents
6Read the instructions
Repository languagesC# 98.04%2

Shares calculated from GitHub Linguist bytes.

C#98.04%
98.04%89,769 bytes
PowerShell1.96%
1.96%1,795 bytes
Language%Bytes
C#98.04%89,769
PowerShell1.96%1,795

1. Overview

1.1. Why it exists

Production .NET 6+ Serilog sink bridging structured logging and Sentry error telemetry with zero allocation overhead.

1.2. Best fit

Enterprise .NET microservice error observability and distributed trace correlation.

2. Use cases

NuGet Serilog sink for .NET developers that sends logs, exceptions and traces to Sentry, with ASP.NET Core context.

Use-case diagram for Serilog.Sinks.SentrySDK: Configure WriteTo.Sentry; Send logs and exceptions; Trace each log as a span; Attach HTTP request context; Scrub data before sending; Publish six NuGet packagesSerilog.Sinks.SentrySDKConfigure WriteTo.SentrySend logs and exceptionsTrace each log as a spanAttach HTTP request contextScrub data before sendingPublish six NuGet packages.NET developer«system»Sentry«system»NuGet.org
People on the left, external systems on the right; each oval is a use case backed by the files cited below.
Configure WriteTo.Sentry
.NET developer

SentrySinkExtensions.cs adds WriteTo.Sentry with a DSN and options such as environment, release, sampleRate, tags and enableTracing, usable from code or the Serilog section of appsettings.json.

Send logs and exceptions
.NET developerSentry

SentrySink.Emit maps the Serilog level, copies properties into scope extras and tags, adds breadcrumbs and calls CaptureMessage or CaptureException.

Trace each log as a span
.NET developerSentry

With enableTracing on, Emit starts a transaction named from the message template and a child span through ITransactionService, then finishes both.

Attach HTTP request context
.NET developerSentry

The AspNetCore package adds app.AddSentryContext() middleware and HttpContextDestructingPolicy so events carry the user, headers and request data.

Scrub data before sending
.NET developer

An optional beforeSend callback is chained after the sink's own handling; the SentryWeb demo also rewrites messages with a Serilog enricher (Scrubbing/DivisionByZeroFilter.cs).

Publish six NuGet packages
NuGet.org

.github/workflows/CI.yml packs the main, .6 and .10 package ids for net6.0 and net10.0 and pushes them to NuGet.org when a GitHub release is published.

2.1. Scenario: Report errors from an ASP.NET Core app to Sentry

  1. Run dotnet add package Serilog.Sinks.SentrySDK and dotnet add package Serilog.Sinks.SentrySDK.AspNetCore.
  2. Put the project DSN under Serilog, WriteTo, Sentry, Args in appsettings.json.
  3. Build the logger with ReadFrom.Configuration, Destructure.With<HttpContextDestructingPolicy>() and the CheckIfCaptured filter.
  4. Call app.AddSentryContext() in Startup.Configure.
  5. Trigger an error, for example with dotnet run --project demos/SentryWeb/SentryWeb.csproj, and find the event with its request data in Sentry.

Files readREADME.mddemos/README.mdsrc/Serilog.Sinks.SentrySDK/SentrySink.cssrc/Serilog.Sinks.SentrySDK/SentrySinkExtensions.cssrc/Serilog.Sinks.SentrySDK.AspNetCore/SentrySinkContextMiddleware.cssrc/Serilog.Sinks.SentrySDK.AspNetCore/SerilogSentryExtensions.csdemos/SentryWeb/Scrubbing/DivisionByZeroFilter.cs.github/workflows/CI.yml

3. Getting started

These commands come from the repository documentation. They were not run during this review.

README.md · Installation
dotnet add package Serilog.Sinks.SentrySDK
Install-Package Serilog.Sinks.SentrySDK
README.md · Build, run tests, and coverage (local development)
dotnet restore src/Serilog.Sinks.SentrySDK/Serilog.Sinks.SentrySDK.csproj
dotnet build src/Serilog.Sinks.SentrySDK/Serilog.Sinks.SentrySDK.csproj -c Release
dotnet build src/Serilog.Sinks.SentrySDK.AspNetCore/Serilog.Sinks.SentrySDK.AspNetCore.csproj -c Release
dotnet test src/Serilog.Sinks.SentrySDK.Tests/Serilog.Sinks.SentrySDK.Tests.csproj
dotnet test src/Serilog.Sinks.SentrySDK.AspNetCore.Tests/Serilog.Sinks.SentrySDK.AspNetCore.Tests.csproj
README.md · Build, run tests, and coverage (local development)
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=./reports/coverage src/Serilog.Sinks.SentrySDK.Tests/Serilog.Sinks.SentrySDK.Tests.csproj
README.md · Code formatting (dotnet format)
dotnet restore src/Serilog.Sinks.SentrySDK.sln
dotnet format src/Serilog.Sinks.SentrySDK.sln
README.md · Code formatting (dotnet format)
dotnet format src/Serilog.Sinks.SentrySDK.sln --verify-no-changes

4. Repository references

Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.

Prerequisites and first run

4.1. Installation

README.md

The library is available on NuGet as Serilog.Sinks.SentrySDK, or alternate ids Serilog.Sinks.SentrySDK.6 / Serilog.Sinks.SentrySDK.10 if you want a single target framework per package. You can install it with the following command: This package references the Sentry NuGet package (6.3.2), the same major line as the Sentry for .NET documentation. For generic SDK setup (DSN, SendDefaultPii, debug), see the official Quick Start. Initialize the SDK as early as possible so startup failures are reported. This sink calls SentrySdk.Init internally when you configure WriteTo.Sentry with a DSN; avoid calling SentrySdk.Init again for the same process unless you coordinate a single initialization path.
Read the full instructions ↗

4.2. Build, run tests, and coverage (local development)

README.md

Prerequisites: .NET SDK 10 to build and run tests. The published libraries multi-target net6.0 and net10.0 (one package includes both under lib/). CI also installs the 6.0.x SDK band so net6.0 targets build cleanly on the runner. From the repository root: Run tests with coverage (same approach as CI, using coverlet): CI uploads Cobertura to Codecov; keep or improve coverage when you change production code.
Read the full instructions ↗

4.3. Installation (PACKAGE_README.md)

src/PACKAGE_README.md

Core sink: ASP.NET Core companion (user/request context in logs): Alternate ids (single TFM per package): Serilog.Sinks.SentrySDK.6, Serilog.Sinks.SentrySDK.10, and matching AspNetCore ids — see Available packages. This stack references the Sentry NuGet package (6.3.2), the same major line as Sentry for .NET. For DSN, SendDefaultPii, and debug options, see the Quick Start. Initialize as early as possible so startup failures are reported. This sink calls SentrySdk.Init when you configure WriteTo.Sentry with a DSN; avoid a second SentrySdk.Init in the same process unless you deliberately use one initialization path. Set a valid Sentry DSN in appsettings.json or in code. Without a DSN, the sink throws when the DSN argument is empty. Demos show JSON and programmatic configuration.
Read the full instructions ↗

4.4. Getting started

src/PACKAGE_README.md

Add the sink so logs are sent to Sentry. You can use Serilog.Settings.Configuration with JSON: Optional configureSentryOptions and beforeSend on WriteTo.Sentry map to init-time SentryOptions and a chained SetBeforeSend. A fuller argument list and examples are in the repository README — Getting Started.
Read the full instructions ↗

4.5. Installation (PACKAGE_README_NET6.md)

src/PACKAGE_README_NET6.md

This stack references Sentry (6.3.2). See the Sentry .NET Quick Start. This sink calls SentrySdk.Init when you configure WriteTo.Sentry with a DSN; avoid duplicate in-process initialization.
Read the full instructions ↗
API and integration

4.6. Serilog.Sinks.SentrySDK

README.md

A Serilog sink for Sentry that simplifies error and log management in your applications. Based on serilog-contrib/serilog-sinks-sentry
Read the full instructions ↗

4.7. Sentry SDK

README.md

Reference for the Sentry .NET SDK SentryOptions (this package references Sentry 6.3.2). The This sink column describes how each member relates to WriteTo.Sentry in this library.
Read the full instructions ↗

4.8. Contributing to Serilog.Sinks.SentrySDK

CONTRIBUTING.md

Thank you for helping improve this project. This document describes how we work on GitHub and what we expect in contributions.
Read the full instructions ↗

4.9. Serilog.Sinks.SentrySDK (PACKAGE_README.md)

src/PACKAGE_README.md

A Serilog sink for Sentry that simplifies error and log management in your applications. It builds on the Sentry .NET SDK and official Serilog integration.
Read the full instructions ↗

4.10. Sentry SDK options vs this sink

src/PACKAGE_README.md

This package aligns with Sentry .NET 6.3.2. The repository README maps SentryOptions properties and methods to WriteTo.Sentry parameters (large tables): Sentry SDK and Mapping to WriteTo.Sentry. Further reading: Data Management, Structured logs, Migration guide.
Read the full instructions ↗
Development and contributions

4.11. Tests and coverage

CONTRIBUTING.md

  • Run tests locally before pushing:
  • CI runs these tests and uploads coverage to Codecov. Prefer new tests for new code paths (e.g. factories, sink behavior, middleware) so coverage does not drop unnecessarily.
Read the full instructions ↗

4.12. Demos, build, contributing

src/PACKAGE_README.md

  • Demos: demos/README.md on GitHub
  • Solution and local build/test commands: README — Build, run tests, and coverage
  • CONTRIBUTING.md Full documentation (CI, publishing, formatting): README.md on GitHub.
Read the full instructions ↗
Source documentation

6 documents read from 6 candidates.

5. Features and components 2

Sink and SDK boundary
SentrySink.cs defines an SDK wrapper interface with capture-message, capture-exception and transaction methods. The wrapper delegates to SentrySdk. This boundary gives tests a substitute for the external SDK calls.
Application context
The source tree separates the sink package from ASP.NET Core integration and tests. Request and user factories adapt HTTP context. Logging configuration and request enrichment therefore have different responsibilities.

6. Architecture

Expand a component to follow its connections, or explore the full diagram.

System components Context
Mermaid Interactive diagram

System overview of the components and connections verified in the repository.

Static architecture view for Serilog.Sinks.SentrySDK
Static preview. The interactive diagram replaces it after Mermaid loads.
flowchart LR
node_app(("Application"))
node_serilog["Serilog pipeline"]
node_sentryservice(("Sentry service"))

subgraph group_sentry["Sentry event delivery"]
  node_requestfactory["Request factory"]
  node_userfactory["User factory"]
  node_sentrysdk["Sentry SDK"]
end

subgraph group_logging["Serilog integration"]
  node_sinkconfig["Sink registration"]
  node_sink["Event sink<br/>[SentrySink.cs]"]
end

subgraph group_web["ASP.NET Core context"]
  node_contextadapter["HTTP adapter"]
  node_middleware["Request middleware"]
  node_destructure["Context destructuring"]
  node_contextcontract["HTTP context contract"]
end

node_app -->|"writes events"| node_serilog
node_serilog -->|"configures sink"| node_sinkconfig
node_sinkconfig -->|"creates sink"| node_sink
node_sentrysdk -.->|"sends telemetry"| node_sentryservice
node_middleware -->|"pushes context"| node_contextadapter
node_middleware -->|"logs exceptions"| node_serilog
node_contextadapter -->|"implements"| node_contextcontract
node_destructure -->|"recognizes context"| node_contextcontract
node_requestfactory -->|"reads request data"| node_contextcontract
node_userfactory -->|"reads user data"| node_contextcontract
group_logging --> group_sentry
class node_sinkconfig,node_sink toneBlue
class node_requestfactory,node_userfactory,node_sentrysdk toneAmber
class node_contextadapter,node_middleware,node_destructure,node_contextcontract toneMint
class node_app,node_serilog,node_sentryservice toneIndigo

A Serilog sink that configures the Sentry SDK and maps log events to messages, exceptions, breadcrumbs and optional traces. The ASP.NET Core package adds request and user context through an HTTP-context adapter.

Components
12
Connections
13
Evidence-backed links
10/13
Text version of the diagram

The diagram merges parallel links between groups, so it shows 11 of 13. Full list:

  • Application → Serilog pipeline (writes events)
  • Serilog pipeline → Sink registration (configures sink)
  • Sink registration → Event sink (creates sink)
  • Event sink → Sentry SDK (captures events)
  • Sentry SDK → Sentry service (sends telemetry)
  • Request middleware → HTTP adapter (pushes context)
  • Request middleware → Serilog pipeline (logs exceptions)
  • HTTP adapter → HTTP context contract (implements)
  • Context destructuring → HTTP context contract (recognizes context)
  • Request factory → HTTP context contract (reads request data)
  • User factory → HTTP context contract (reads user data)
  • Event sink → Request factory (uses request context)
  • Event sink → User factory (uses user context)
Follow one path through the code

Follow an exception-bearing log through the sink and compare it with a message-only event. The wrapper exposes separate capture operations, so a useful test checks the chosen operation and its event data, not only that a call occurred.

7. Technical dossier

Built from the source at commit d0b5c25 (45 files). Each item comes from a pattern match in the code, so open the linked file before relying on it.

7.1. Layers and modules

Folders are sorted into layers by name, from the user interface down to data access. Because the sorting uses names only, the diagram says nothing about calls between layers.

Mermaid Layered view
flowchart TB
  subgraph L_presentation["Presentation"]
    direction TB
    presentation_0["Serilog.Sinks.SentrySDK.AspNetCore.Tests/reports<br/>1 file"]
    presentation_1["Serilog.Sinks.SentrySDK.Tests/reports<br/>1 file"]
    presentation_2["demos/SentryWeb<br/>1 file"]
  end
  subgraph L_interface["Entry points and API"]
    direction TB
    interface_0["demos/SentryWeb<br/>1 file"]
  end
  subgraph L_domain["Domain and business rules"]
    direction TB
    domain_0["demos/SentryWeb<br/>1 file"]
  end
  subgraph L_infrastructure["Data and infrastructure"]
    direction TB
    infrastructure_0["Serilog.Sinks.SentrySDK.AspNetCore<br/>1 file"]
    infrastructure_1["demos/SentryWeb<br/>1 file"]
  end
  subgraph L_core["Core source"]
    direction TB
    core_0["Serilog.Sinks.SentrySDK<br/>6 files"]
    core_1["Serilog.Sinks.SentrySDK.AspNetCore<br/>4 files"]
    core_2["demos/SentryWeb<br/>4 files"]
    core_3["(root)<br/>1 file"]
    core_more["+1"]
  end
  subgraph L_tests["Tests"]
    direction TB
    tests_0["Serilog.Sinks.SentrySDK.Tests<br/>6 files"]
    tests_1["Serilog.Sinks.SentrySDK.AspNetCore.Tests<br/>5 files"]
  end
  subgraph L_hosting["Build, CI and hosting"]
    direction TB
    hosting_0[".github<br/>10 files"]
  end
  L_presentation ~~~ L_interface
  L_interface ~~~ L_domain
  L_domain ~~~ L_infrastructure
  L_infrastructure ~~~ L_core
  L_core ~~~ L_tests
  L_core ~~~ L_hosting
Modules and their main layer
ModuleLayerFilesTypesExtensions
demos/SentryWebCore source85.cs .js .css
Serilog.Sinks.SentrySDKCore source614.cs
Serilog.Sinks.SentrySDK.AspNetCoreCore source55.cs
(root)Core source10.ps1
Serilog.Sinks.SentrySDK.AspNetCore.Tests/reportsPresentation10.xml
Serilog.Sinks.SentrySDK.Tests/reportsPresentation10.xml
demos/SentryConsoleCore source11.cs

7.2. C4 model

From system context to code declarations. Each level reflects the available source evidence.

UML 1 · System context
1 · System context

The widest C4 view: who uses the project and which outside systems and data stores it relies on. Rendered with uml-mcp.

PlantUML source
@startuml
!include <C4/C4_Context>
LAYOUT_LEFT_RIGHT()
System(SYS, "Serilog.Sinks.SentrySDK", "Serilog.Sinks.SentrySDK connects a .NET logging pipeline to the Sentr…")
System_Ext(E0, "Sentry")
Rel(SYS, E0, "Calls")
@enduml
UML 2 · Containers
2 · Containers

One level closer: the parts that run separately inside the project, their main language and how calls flow between them. Rendered with uml-mcp.

PlantUML source
@startuml
!include <C4/C4_Container>
LAYOUT_LEFT_RIGHT()
System_Boundary(SYS, "Serilog.Sinks.SentrySDK") {
  Container(APP, "Serilog.Sinks.SentrySDK", "C#")
}
System_Ext(E0, "Sentry")
Rel(APP, E0, "Calls")
@enduml
UML 3 · Components and layers
3 · Components and layers

Modules grouped by source-layer classification. Boundaries show organization, not runtime isolation or call relationships. Rendered with uml-mcp.

PlantUML source
@startuml
!include <C4/C4_Component>
LAYOUT_TOP_DOWN()
System_Boundary(SYS, "Serilog.Sinks.SentrySDK") {
Boundary(L0, "Presentation", "layer") {
Component(M0_0, "demos/SentryWeb", ".css", "6 files")
Component(M0_1, "Serilog.Sinks.SentrySDK.AspNetCore.Tests/reports", ".xml", "1 files")
Component(M0_2, "Serilog.Sinks.SentrySDK.Tests/reports", ".xml", "1 files")
}
Boundary(L1, "Entry points and API", "layer") {
Component(M1_0, "demos/SentryWeb", "C#", "1 files")
}
Boundary(L2, "Domain and business rules", "layer") {
Component(M2_0, "demos/SentryWeb", "C#", "1 files")
}
Boundary(L3, "Data and infrastructure", "layer") {
Component(M3_0, "demos/SentryWeb", "JavaScript", "11 files")
Component(M3_1, "Serilog.Sinks.SentrySDK.AspNetCore", "C#", "1 files")
}
Boundary(L4, "Core source", "layer") {
Component(M4_0, "Serilog.Sinks.SentrySDK", "C#", "6 files")
Component(M4_1, "demos/SentryWeb", "C#, JavaScript", "5 files")
Component(M4_2, "Serilog.Sinks.SentrySDK.AspNetCore", "C#", "4 files")
Component(M4_3, "(root)", ".ps1", "1 files")
Component(M4_4, "demos/SentryConsole", "C#", "1 files")
}
Boundary(L5, "Tests", "layer") {
Component(M5_0, "Serilog.Sinks.SentrySDK.Tests", "C#", "6 files")
Component(M5_1, "Serilog.Sinks.SentrySDK.AspNetCore.Tests", "C#", "5 files")
}
Boundary(L6, "Build, CI and hosting", "layer") {
Component(M6_0, ".github", ".yml, .md", "10 files")
}
}
@enduml
UML 4 · Code
4 · Code

Selected declarations, fields and methods grouped by source file. No inheritance or call edges are inferred. Rendered with uml-mcp.

PlantUML source
@startuml
skinparam backgroundColor transparent
skinparam shadowing false
skinparam roundCorner 10
skinparam defaultFontName Arial
skinparam defaultFontSize 13
skinparam ArrowColor #4e6070
skinparam ArrowFontColor #3d4f5f
skinparam titleFontSize 14
skinparam actorBorderColor #006a62
skinparam actorBackgroundColor #e9f3f4
skinparam usecaseBorderColor #006a62
skinparam usecaseBackgroundColor #e9f3f4
skinparam componentBorderColor #006a62
skinparam componentBackgroundColor #e9f3f4
skinparam interfaceBorderColor #006a62
skinparam interfaceBackgroundColor #ffffff
skinparam nodeBorderColor #4e6070
skinparam nodeBackgroundColor #f4f8fb
skinparam databaseBorderColor #006a62
skinparam databaseBackgroundColor #ffffff
skinparam cloudBorderColor #4e6070
skinparam cloudBackgroundColor #f0f5fa
skinparam artifactBorderColor #006a62
skinparam artifactBackgroundColor #ffffff
skinparam rectangleBorderColor #b0c2d3
skinparam activityBorderColor #006a62
skinparam activityBackgroundColor #e9f3f4
skinparam partitionBorderColor #b0c2d3
skinparam stereotypeCBackgroundColor #ffffff
top to bottom direction
hide empty members
package "Serilog.Sinks.SentrySDK" {
package "src/Serilog.Sinks.SentrySDK/SentrySink.cs" as F0 {
class "SentrySink" as T0_0 {
  Emit()
  EmitWithoutTracing()
  GetBreadcrumbLevel()
  GetSentryLevel()
  ExceptionDataToScopeExtrasDictionary()
  RenderPropertyValuesToStringDictionary()
}
class "ISentrySdkWrapper" as T0_1 {
  CaptureMessage()
  CaptureException()
  StartTransaction()
}
}
package "demos/SentryConsole/Program.cs" as F1 {
class "Program" as T1_0 {
  Main()
  ThrowDivideByZeroSecondTier()
  DivByZero()
  ThrowParseExceptionSecondTier()
  ConvertToInt()
}
}
package "demos/SentryWeb/Startup.cs" as F2 {
class "Startup" as T2_0 {
  ConfigureLogging()
  ConfigureServices()
  Configure()
}
}
package "src/Serilog.Sinks.SentrySDK.AspNetCore/ExceptionExtensions.cs" as F3 {
class "ExceptionExtensions" as T3_0 {
  CheckIfCaptured()
  SetCaptured()
}
}
package "demos/SentryWeb/Models/ErrorViewModel.cs" as F4 {
class "ErrorViewModel" as T4_0 {
  RequestId
}
}
}
@enduml

7.3. Data flow

The calls from the GitDiagram graph, in the order you meet them from the entry points. GitDiagram generates the graph with AI; the file paths it cites were checked against the repository tree.

Mermaid Sequence diagram
sequenceDiagram
  autonumber
  participant P0 as Request middleware
  participant P1 as HTTP adapter
  participant P2 as Serilog pipeline
  participant P3 as Context destructuring
  participant P4 as HTTP context contract
  participant P5 as Application
  participant P6 as Sink registration
  participant P7 as Event sink
  participant P8 as Sentry SDK
  participant P9 as Request factory
  participant P10 as User factory
  participant P11 as Sentry service
  P0->>P1: pushes context
  P0->>P2: logs exceptions
  P3->>P4: recognizes context
  P5->>P2: writes events
  P1->>P4: implements
  P2->>P6: configures sink
  P6->>P7: creates sink
  P7->>P8: captures events
  P7--)P9: uses request context
  P7--)P10: uses user context
  P8--)P11: sends telemetry
  P9->>P4: reads request data
  P10->>P4: reads user data
Steps as text
  1. Request middleware to HTTP adapter pushes context
  2. Request middleware to Serilog pipeline logs exceptions
  3. Context destructuring to HTTP context contract recognizes context
  4. Application to Serilog pipeline writes events
  5. HTTP adapter to HTTP context contract implements
  6. Serilog pipeline to Sink registration configures sink
  7. Sink registration to Event sink creates sink
  8. Event sink to Sentry SDK captures events
  9. Event sink to Request factory uses request context
  10. Event sink to User factory uses user context
  11. Sentry SDK to Sentry service sends telemetry
  12. Request factory to HTTP context contract reads request data
  13. User factory to HTTP context contract reads user data

7.4. Public interface

Outside code can use everything listed here. The project also declares 25 public types.

Entry points

7.5. Private interface

These names are internal by the language’s conventions: a leading underscore, private, static or pub(crate).

private / internal method
3

7.6. Services

7.7. Entities and data model 1

EntityKindFirst fields
ErrorViewModelRecord or interfaceRequestId

7.8. Business logic

Once UI code and the services and entities above are set aside, these classes have the most methods.

SentrySink Core source, 10 methods
Emit, EmitWithoutTracing, GetBreadcrumbLevel, GetSentryLevel, ExceptionDataToScopeExtrasDictionary, RenderPropertyValuesToStringDictionary
Program Core source, 5 methods
Main, ThrowDivideByZeroSecondTier, DivByZero, ThrowParseExceptionSecondTier, ConvertToInt
ISentrySdkWrapper Core source, 3 methods
CaptureMessage, CaptureException, StartTransaction
Startup Core source, 3 methods
ConfigureLogging, ConfigureServices, Configure
ExceptionExtensions Core source, 2 methods
CheckIfCaptured, SetCaptured

7.9. External integrations

7.10. Stack and dependencies

.NET demos/SentryConsole/SentryConsole.csproj 7 runtime

Target net10.0

Open the manifest

.NET src/Serilog.Sinks.SentrySDK.AspNetCore.Tests/Serilog.Sinks.SentrySDK.AspNetCore.Tests.csproj 17 runtime

Target net10.0

Open the manifest

.NET src/Serilog.Sinks.SentrySDK.AspNetCore/Serilog.Sinks.SentrySDK.AspNetCore.csproj 4 runtime

Target net6.0;net10.0 Target net6.0 Target net10.0

Open the manifest

.NET src/Serilog.Sinks.SentrySDK.Tests/Serilog.Sinks.SentrySDK.Tests.csproj 19 runtime

Target net10.0

Open the manifest

.NET src/Serilog.Sinks.SentrySDK/Serilog.Sinks.SentrySDK.csproj 10 runtime

Target net6.0;net10.0 Target net6.0 Target net10.0

Open the manifest

External dependencies

22 declared packages (22 runtime, 0 development) in demos/SentryConsole/SentryConsole.csproj, src/Serilog.Sinks.SentrySDK.AspNetCore.Tests/Serilog.Sinks.SentrySDK.AspNetCore.Tests.csproj, src/Serilog.Sinks.SentrySDK.AspNetCore/Serilog.Sinks.SentrySDK.AspNetCore.csproj, src/Serilog.Sinks.SentrySDK.Tests/Serilog.Sinks.SentrySDK.Tests.csproj, src/Serilog.Sinks.SentrySDK/Serilog.Sinks.SentrySDK.csproj.

Package table 22
External dependencies
PackageVersionScopePurposeRegistry
Newtonsoft.Json13.0.4runtime—nuget.org
Serilog4.3.1runtimeLogging and observabilitynuget.org
Serilog.Exceptions8.4.0runtimeLogging and observabilitynuget.org
Serilog.Sinks.File7.0.0runtimeLogging and observabilitynuget.org
Sentry.Serilog6.4.1runtimeLogging and observabilitynuget.org
Microsoft.Extensions.Configuration.Json10.0.13runtime—nuget.org
Microsoft.Extensions.Configuration.Binder10.0.13runtime—nuget.org
xunit2.9.3runtimeTestingnuget.org
Moq4.20.72runtimeTestingnuget.org
Castle.Core5.2.1runtime—nuget.org
xunit.runner.visualstudio3.1.5runtimeTestingnuget.org
Microsoft.NET.Test.Sdk18.5.1runtimeTestingnuget.org
coverlet.collector10.0.0runtime—nuget.org
FluentAssertions8.9.0runtime—nuget.org
coverlet.msbuild10.0.0runtimeBuild toolingnuget.org
Sentry6.4.1runtimeLogging and observabilitynuget.org
Serilog.Settings.Configuration10.0.0runtimeLogging and observabilitynuget.org
Serilog.Sinks.Console6.1.1runtimeLogging and observabilitynuget.org
Serilog.Sinks.Sentry2.4.3runtimeLogging and observabilitynuget.org
Microsoft.SourceLink.GitHub10.0.402runtime—nuget.org
Microsoft.AspNetCore.Http.Abstractions2.3.13runtimeWeb frameworknuget.org
Serilog.Sinks.TestCorrelator4.0.0runtimeTestingnuget.org

7.11. CI/CD pipeline

4 GitHub Actions workflows, 11 jobs. Each box is a job; double-bordered boxes publish or deploy, and arrows follow needs.

Mermaid Pipeline flow
flowchart LR
  subgraph wf0[".NET Core CI"]
    direction LR
    wf0_build["build<br/>ubuntu-latest"]
    wf0_test["test<br/>ubuntu-latest"]
    wf0_package["package<br/>ubuntu-latest"]
    wf0_push[["push<br/>ubuntu-latest"]]
  end
  subgraph wf1["CodeQL"]
    direction LR
    wf1_analyze["Analyze<br/>ubuntu-latest"]
  end
  subgraph wf2["Publish NuGet (.6 and .10 lines)"]
    direction LR
    wf2_publish_alternate_tfm_packages[["publish-alternate-tfm-packages<br/>ubuntu-latest"]]
  end
  subgraph wf3[".NET Core Test"]
    direction LR
    wf3_format["format<br/>ubuntu-latest"]
    wf3_restore["restore<br/>ubuntu-latest"]
    wf3_build["build<br/>ubuntu-latest"]
    wf3_test[["test<br/>ubuntu-latest"]]
    wf3_coverage["coverage"]
  end
  t0(["release · manual run"])
  t1(["push · pull request · schedule"])
  t2(["manual run"])
  t3(["push · pull request"])
  d0[("NuGet")]
  t0 --> wf0_build
  wf0_build --> wf0_test
  wf0_test --> wf0_package
  wf0_package --> wf0_push
  wf0_push -.-> d0
  t1 --> wf1_analyze
  t2 --> wf2_publish_alternate_tfm_packages
  wf2_publish_alternate_tfm_packages -.-> d0
  t3 --> wf3_format
  wf3_format --> wf3_restore
  wf3_restore --> wf3_build
  wf3_build --> wf3_test
  t3 --> wf3_coverage
Workflows, triggers, jobs and targets
WorkflowTriggersJobsPublishes to
.NET Core CI
.github/workflows/CI.yml
release, manual run
  • build ubuntu-latest
    Checkout code · Setup .NET Core · Install dependencies - Serilog.Sinks.SentrySDK · Install dependencies - Serilog.Sinks.SentrySDK.AspNetCor · Build - Serilog.Sinks.SentrySDK · Build - Serilog.Sinks.SentrySDK.AspNetCore
  • test ← build ubuntu-latest
    actions/checkout · Setup .NET Core · Restore and test
  • package ← test ubuntu-latest
    actions/checkout · Setup .NET Core · Pack Serilog.Sinks.SentrySDK (net6 + net10) · Pack Serilog.Sinks.SentrySDK.AspNetCore (net6 + net10) · Pack Serilog.Sinks.SentrySDK.6 (net6 only) · Pack Serilog.Sinks.SentrySDK.AspNetCore.6 (net6 only)
  • push ← package ubuntu-latest
    actions/checkout · Setup .NET Core · Download NuGet packages · Push all NuGet packages (main, .6 net6-only, .10 net10-o · Upload packages to GitHub Release
NuGet
CodeQL
.github/workflows/codeql.yml
push, pull request, schedule
  • Analyze ubuntu-latest
    Checkout repository · Setup .NET · Initialize CodeQL · Autobuild · Perform CodeQL Analysis
—
Publish NuGet (.6 and .10 lines)
.github/workflows/publish-nuget-net6.yml
manual run
  • publish-alternate-tfm-packages ubuntu-latest
    Checkout · Setup .NET · Restore, build, and test · List packages · Push to NuGet.org
NuGet
.NET Core Test
.github/workflows/tests.yml
push, pull request
  • format ubuntu-latest
    actions/checkout · Setup .NET Core · Restore solution and verify dotnet format
  • restore ← format ubuntu-latest
    actions/checkout · Setup .NET Core · Install dependencies - Serilog.Sinks.SentrySDK · Install dependencies - Serilog.Sinks.SentrySDK.AspNetCor
  • build ← restore ubuntu-latest
    actions/checkout · Setup .NET Core · Build - Serilog.Sinks.SentrySDK · Build - Serilog.Sinks.SentrySDK.AspNetCore
  • test ← build ubuntu-latest
    actions/checkout · Setup .NET Core · Test - Serilog.Sinks.SentrySDK.AspNetCore.Tests · Test - Serilog.Sinks.SentrySDK.Tests · Upload coverage SentrySDK.AspNetCore.Tests to GitHub Art · Upload coverage SentrySDK.Tests to GitHub Artifacts
  • coverage
    Checkout · Download reports SentrySDK.AspNetCore.Tests · Download reports SentrySDK.Tests · Codecov SentrySDK.AspNetCore.Tests · Codecov SentrySDK.Tests
—

7.12. Deployment

Mermaid Deployment diagram
flowchart LR
  repo[("GitHub repository")]
  ci[["GitHub Actions<br/>4 workflows"]]
  pub_NuGet[("NuGet")]
  repo -->|"push or pull request"| ci
  ci -->|"publishes"| pub_NuGet

Where it runs

Published to

7.13. Monitoring

What the code logs, measures and exposes to tell whether it is working.

7.14. Security

Supply chain

Environment variables 1

The page lists names without their values and underlines the ones that look like secrets.

SENTRY_DSN

7.15. Testing

Test files
11
Source files
23
Test cases, about
50
Unit tests
11

Code coverage

No measured coverage report in the analyzed sources.

Where the tests are

src/Serilog.Sinks.SentrySDK.Tests 6 src/Serilog.Sinks.SentrySDK.AspNetCore.Tests 5

Continuous integration

.NET Core CI
dotnet test
CodeQL
codeql
.NET Core Test
dotnet test
UML CI pipeline
CI pipeline

The main GitHub Actions workflow runs these steps. Jobs that run in parallel sit side by side. Rendered with uml-mcp.

PlantUML source
@startuml
skinparam backgroundColor transparent
skinparam shadowing false
skinparam roundCorner 10
skinparam defaultFontName Arial
skinparam defaultFontSize 13
skinparam ArrowColor #4e6070
skinparam ArrowFontColor #3d4f5f
skinparam titleFontSize 14
skinparam actorBorderColor #006a62
skinparam actorBackgroundColor #e9f3f4
skinparam usecaseBorderColor #006a62
skinparam usecaseBackgroundColor #e9f3f4
skinparam componentBorderColor #006a62
skinparam componentBackgroundColor #e9f3f4
skinparam interfaceBorderColor #006a62
skinparam interfaceBackgroundColor #ffffff
skinparam nodeBorderColor #4e6070
skinparam nodeBackgroundColor #f4f8fb
skinparam databaseBorderColor #006a62
skinparam databaseBackgroundColor #ffffff
skinparam cloudBorderColor #4e6070
skinparam cloudBackgroundColor #f0f5fa
skinparam artifactBorderColor #006a62
skinparam artifactBackgroundColor #ffffff
skinparam rectangleBorderColor #b0c2d3
skinparam activityBorderColor #006a62
skinparam activityBackgroundColor #e9f3f4
skinparam partitionBorderColor #b0c2d3
skinparam stereotypeCBackgroundColor #ffffff
title .NET Core CI
start
partition "build" {
  :Checkout code;
  :Setup .NET Core;
  :Install dependencies - Serilog.Sinks.Sentry…;
  :Install dependencies - Serilog.Sinks.Sentry…;
  :Build - Serilog.Sinks.SentrySDK;
  :Build - Serilog.Sinks.SentrySDK.AspNetCore;
}
partition "test" {
  :actions/checkout;
  :Setup .NET Core;
  :Restore and test;
}
partition "package" {
  :actions/checkout;
  :Setup .NET Core;
  :Pack Serilog.Sinks.SentrySDK (net6 + net10);
  :Pack Serilog.Sinks.SentrySDK.AspNetCore (ne…;
  :Pack Serilog.Sinks.SentrySDK.6 (net6 only);
  :Pack Serilog.Sinks.SentrySDK.AspNetCore.6 (…;
  :Pack Serilog.Sinks.SentrySDK.10 (net10 only);
  :Pack Serilog.Sinks.SentrySDK.AspNetCore.10 …;
}
partition "push" {
  :actions/checkout;
  :Setup .NET Core;
  :Download NuGet packages;
  :Push all NuGet packages (main, .6 net6-only…;
  :Upload packages to GitHub Release;
}
stop
@enduml

Nothing found for: Database.

8. Types and file structure

38 declared types, with 12 in the base-relationship overview.

Type diagram
classDiagram
direction TB
class ta0f4fc6d8b31["ISentryRequestFactory"] {
  <<interface>>
  Create()
}
class tab0f434b248f["SentryRequestFactory"] {
  SentryRequestFactory()
  Create()
}
class t94a164d611c8["ISentryRequest"] {
  <<interface>>
}
class t66938c58944a["SentryRequest"] {
}
class td9dd9f1be134["ISentrySdkWrapper"] {
  <<interface>>
  CaptureMessage()
  CaptureException()
  StartTransaction()
}
class t436d77520181["SentrySdkWrapper"] {
  SentrySdkWrapper()
  CaptureMessage()
  CaptureException()
  StartTransaction()
}
class t9aa877270a99["ITransactionService"] {
  <<interface>>
  StartChild()
}
class t7f1535817357["TransactionService"] {
  StartChild()
}
class t53092b4cd27d["SentrySink"] {
  SentrySink()
  Emit()
  EmitWithoutTracing()
  GetBreadcrumbLevel()
}
class t3bef4532763b["SentrySinkExtensions"] {
  Sentry()
}
class t6b344cd3bb4d["Program"] {
  Main()
  ThrowDivideByZeroSecondTier()
  DivByZero()
  ThrowParseExceptionSecondTier()
}
class t0108ee6641d7["HomeController"] {
  Index()
  About()
  Contact()
  Error()
}
ta0f4fc6d8b31 <|.. tab0f434b248f
t94a164d611c8 <|.. t66938c58944a
td9dd9f1be134 <|.. t436d77520181
t9aa877270a99 <|.. t7f1535817357
class bc2d528bdb08a["ILogEventSink"] {
  <<unresolved_base>>
}
t53092b4cd27d ..> bc2d528bdb08a : declared base
class b06fa01e7e2b1["IDisposable"] {
  <<unresolved_base>>
}
t53092b4cd27d ..> b06fa01e7e2b1 : declared base
class bd8f3faa41a98["Controller"] {
  <<unresolved_base>>
}
t0108ee6641d7 ..> bd8f3faa41a98 : declared base

Unresolved bases remain labelled; full signatures are not reconstructed.

9. Reference

32 / 32 eligible files read (117 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.

What the scan covers

Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.

Linguist statistics cover the whole repository and may include other languages.

11. Files to read 3

12. Glossary

Repository

The versioned source files, configuration, and history of a project.

README

The repository’s entry document, usually covering its purpose and initial setup.

Dependency

A library, tool, or service that another component needs to build or run.

HTTP

A request-and-response protocol used by browsers and web services. A method, path, headers, and optional body describe a request.

CLI

A text interface in which commands and arguments select operations. Exit codes let scripts detect success or failure.

Continuous integration

Automated checks that run when source changes, such as building, testing, and linting. Passing checks cover only what those checks exercise.

13. References

  1. antoinebou12. (2026, November 5). Serilog.Sinks.SentrySDK. [Software repository] github.com.
  2. antoinebou12. (2026, November 5). Serilog.Sinks.SentrySDK: README. [Repository documentation] github.com.
  3. antoinebou12. (2026, November 5). src/Serilog.Sinks.SentrySDK/SentrySink.cs. [Source file] github.com.
  4. antoinebou12. (2026, November 5). src/Serilog.Sinks.SentrySDK/AspNetCoreSentryRequestFactory.cs. [Source file] github.com.
  5. antoinebou12. (2026, November 5). src/Serilog.Sinks.SentrySDK/SentrySinkExtensions.cs. [Source file] github.com.
  6. Boucher, A. (2026, October 20). Serilog.Sinks.SentrySDK: connecting structured logs to error reporting. [Project article] antoineboucher.info.
  7. Boucher, A. (2021, September 6). Serilog.Sinks.SentrySDK. [Project article] antoineboucher.info.
  8. Boucher, A. (2026, October 23). Serilog.Sinks.SentrySDK: Adapting log events to Sentry. [Project article] antoineboucher.info.

Sources without a publication date show the date they were last checked, November 5, 2026. File links retain the inspected revision where available.