TCIS.Observability.Jwt 1.1.3

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TCIS.Observability.Jwt --version 1.1.3
                    
NuGet\Install-Package TCIS.Observability.Jwt -Version 1.1.3
                    
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="TCIS.Observability.Jwt" Version="1.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TCIS.Observability.Jwt" Version="1.1.3" />
                    
Directory.Packages.props
<PackageReference Include="TCIS.Observability.Jwt" />
                    
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 TCIS.Observability.Jwt --version 1.1.3
                    
#r "nuget: TCIS.Observability.Jwt, 1.1.3"
                    
#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 TCIS.Observability.Jwt@1.1.3
                    
#: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=TCIS.Observability.Jwt&version=1.1.3
                    
Install as a Cake Addin
#tool nuget:?package=TCIS.Observability.Jwt&version=1.1.3
                    
Install as a Cake Tool

TCIS.Observability.Jwt

The TCIS.Observability.Jwt library enhances user identity tracking by extracting and enriching Logs and Metrics with Claims from JWT (JSON Web Token).

🌟 Features

  • Serilog Enrichment: Automatically injects user claims (such as UserId, TenantId, Email) into the Serilog log structure.
  • Facilitates the tracking of errors or actions of a specific user across distributed monitoring systems (e.g., Kibana/Elasticsearch, Seq).

📦 Installation

dotnet add package TCIS.Observability.Jwt

🚀 Setup & Usage

1. Service Registration

In Program.cs, call AddTJwtObservability() to register the JwtLogEnricher:

using TCIS.Observability.Jwt;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddTJwtObservability();

2. Serilog Pipeline Configuration

Use the WithTJwtClaims() extension when defining the Serilog logger:

using Serilog;
using TCIS.Observability.Jwt;

// Build provider to retrieve the enricher
var serviceProvider = builder.Services.BuildServiceProvider();

Log.Logger = new LoggerConfiguration()
    .Enrich.FromLogContext()
    // Activate JWT Enricher
    .Enrich.WithTJwtClaims(serviceProvider) 
    .WriteTo.Console()
    .CreateLogger();

builder.Host.UseSerilog();

Once configured, your system logs will automatically include the important claim properties attached by the user in the HTTP request.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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.1.4-rc.1 56 11/17/2026
1.1.3 66 11/11/2026
1.1.2 66 11/10/2026
1.1.1 64 11/9/2026
1.1.0 76 11/7/2026
1.0.9 66 11/5/2026
1.0.9-rc.2 59 11/5/2026
1.0.9-rc.1 65 11/4/2026
1.0.8 72 11/3/2026
1.0.8-rc.11 63 10/30/2026
1.0.8-rc.10 63 10/30/2026
1.0.8-rc.9 60 10/30/2026
1.0.8-rc.8 66 10/29/2026
1.0.8-rc.7 66 10/27/2026
1.0.8-rc.6 71 10/27/2026
1.0.8-rc.5 66 10/23/2026
1.0.8-rc.4 69 10/23/2026
1.0.8-rc.3 71 10/23/2026
1.0.8-rc.2 69 10/22/2026
1.0.8-rc.1 68 10/22/2026
Loading failed