Yapidoo.Common.Logging 1.0.0

dotnet add package Yapidoo.Common.Logging --version 1.0.0
                    
NuGet\Install-Package Yapidoo.Common.Logging -Version 1.0.0
                    
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="Yapidoo.Common.Logging" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Yapidoo.Common.Logging" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Yapidoo.Common.Logging" />
                    
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 Yapidoo.Common.Logging --version 1.0.0
                    
#r "nuget: Yapidoo.Common.Logging, 1.0.0"
                    
#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 Yapidoo.Common.Logging@1.0.0
                    
#: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=Yapidoo.Common.Logging&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Yapidoo.Common.Logging&version=1.0.0
                    
Install as a Cake Tool

Yapidoo.Common.Logging

Shared Serilog registration, correlation wiring, enrichers, and audit-safe logging helpers for Yapidoo .NET 10 backend services.

This is the maintained documentation file for the package.

What is in this package

  • builder.Host.UseYapidooSerilog(configuration, serviceName)
  • services.AddYapidooCorrelation()
  • LogPropertyNames
  • ServiceNameEnricher
  • CorrelationEnricher
  • AuditLog

Installation

dotnet add package Yapidoo.Common.Logging

Project path

services/common/Yapidoo.Common.Logging

Usage

Program.cs

using Yapidoo.Common.Logging.Registration;

var builder = WebApplication.CreateBuilder(args);

builder.Host.UseYapidooSerilog(builder.Configuration, "Yapidoo.Service.BFF.Api");
builder.Services.AddYapidooCorrelation();

AddYapidooCorrelation() automatically wires correlation middleware and Serilog log-context enrichment for request-scoped properties.

Baseline properties

The package standardizes these properties where relevant:

  • Service
  • Environment
  • CorrelationId
  • TraceId
  • SpanId
  • UserId
  • ClientId
  • EventName
  • EventId

Audit logging

Use AuditLog.Write(...) for audit-significant actions such as login, logout, token revocation, provider exchange, or invitation creation.

Example:

AuditLog.Write(logger, "login", "account", "success", userId: userId, clientId: clientId);

Change the code

Typical flow:

  1. Update registration, enrichers, constants, or audit helpers.
  2. Add or update tests in tests/Yapidoo.Common.Logging.Tests/.
  3. Run local validation:
dotnet restore services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.sln
dotnet test services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.sln
dotnet build services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.csproj -c Release

Update downstream projects

For each service adopting the shared logging baseline:

  1. Add the package or project reference.
  2. Replace service-local Serilog bootstrap duplication with UseYapidooSerilog(...).
  3. Replace service-local correlation registration with AddYapidooCorrelation().
  4. Keep service-specific business logs in the service, but follow shared property names.

Publish to NuGet

dotnet restore services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.sln
dotnet test services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.sln
dotnet build services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.csproj -c Release
dotnet pack services/common/Yapidoo.Common.Logging/Yapidoo.Common.Logging.csproj -c Release --no-build
dotnet nuget push Yapidoo.Common.Logging.nupkg --api-key <api-key> --source https://api.nuget.org/v3/index.json

Package output:

services/common/Yapidoo.Common.Logging/bin/Release/Yapidoo.Common.Logging.<version>.nupkg

Usage rules

  • use shared registration from this package instead of duplicating service-local Serilog bootstrap code
  • keep secrets, tokens, passwords, and provider proofs out of logs
  • keep business-specific event names and audit subjects in the consuming service

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.0 160 3/20/2026

Initial release with shared Serilog registration, correlation middleware wiring, enrichers, and audit helpers.