Serilog.Blazor.SqlServer 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Serilog.Blazor.SqlServer --version 1.0.1
                    
NuGet\Install-Package Serilog.Blazor.SqlServer -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Serilog.Blazor.SqlServer" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Serilog.Blazor.SqlServer" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Serilog.Blazor.SqlServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Serilog.Blazor.SqlServer --version 1.0.1
                    
#r "nuget: Serilog.Blazor.SqlServer, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Serilog.Blazor.SqlServer@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Serilog.Blazor.SqlServer&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Serilog.Blazor.SqlServer&version=1.0.1
                    
Install as a Cake Tool

Problem Statement

When self-hosting Serilog, there's no built-in log view experience. You have to query the serilog table manually and/or build your own UI or query feature. There are products like Seq and Graylog that provide a very polished log search and view exeperience, but have costs of their own. The reason for self-hosting to begin with is to avoid those costs. Furthermore, traditional homegrown log viewers have not provided the kind of insights and capabilities I'm looking for when examining logs. The goal for this project is to build the most capable log view experience I can, addressing longstanding pain points I've come across -- then offer it as a Razor Class Library NuGet package.

With .NET Aspire coming online recently, it has potential to disrupt and improve logging in ASP.NET Core due to its integrated open telemetry support and viewer dashboards. So, I'm very late to this party, and this project may be irrelevant in the short term. But I'm not convinced yet that Aspire's logging/otel does everything I want it to. Furthermore, many apps implement Serilog already, and I think there's a case for meeting apps where they are rather than pushing them to implement Aspire. (I want Aspire to succeed, and am happy to keep tabs on it as it evolves.)

Following is a list of logging pain points and how this project addresses them.

<details> <summary>Unexpected log levels</summary>

Over the years, I've had a hard time getting log levels and namespaces right -- that is, getting the desired level of logging at the right places in my code. Also, I didn't know until recently know there was a way to change levels at runtime without restarting my apps.

This project does these things:

  • Offers the LogLevels abstract class.
  • Implement this in your project to define your default logging levels by namespace prefix. Sample implementation is ApplicationLogLevels.
  • Configure levels at runtime via the LevelToggle component

image

You can see which levels are in effect on which namespaces via the SourceContextFilter.

image

</details>

<details> <summary>Difficulties with correlation/deep tracing</summary> </details>

<details> <summary>Query limitations due to XML dependency in SQL Server sink</summary> </details>

<details> <summary>Logs getting too big</summary> </details>

<details> <summary>No built-in alerting</summary> </details>

<details> <summary>Stack traces are too hard to read</summary> </details>

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.6 152 7/9/2025
1.0.4 282 7/4/2025
1.0.1 147 7/2/2025
1.0.0 147 7/2/2025