Cerbi.Serilog.GovernanceAnalyzer 1.2.39

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

Cerbi.Serilog.Governance

Real-time governance enforcement for Serilog using Cerbi — the structured logging validator for .NET.

Features

  • Block non-compliant log events (required / forbidden fields, enum validation)
  • Optional enrichment with governance metadata (profile, violations, relaxed flag)
  • TagOnlyMode for non-blocking observability
  • Works with any Serilog sinks + other enrichers/filters
  • Relax() bypass tagging (still observable)

Install

dotnet add package Cerbi.Serilog.Governance

Requires runtime packages (pulled transitively): Cerbi.Governance.Core, Cerbi.Governance.Runtime.

Config File (cerbi_governance.json)

{
  "EnforcementMode": "Strict",
  "LoggingProfiles": {
    "Orders": {
      "RequireTopic": false,
      "AllowedTopics": ["Orders", "Users"],
      "FieldSeverities": {
        "userId": "Required",
        "email": "Required",
        "password": "Forbidden"
      },
      "FieldEnums": { "Status": ["Pending", "Approved", "Rejected"] },
      "AllowRelax": true
    }
  }
}

One-Line Setup

using Cerbi.Serilog.Governance;

Log.Logger = new LoggerConfiguration()
  .CerbiGovernance(o =>
  {
    o.Profile = "Orders";            // profile key
    o.ConfigPath = "cerbi_governance.json"; // path
    // o.TagOnlyMode = true;           // uncomment for no blocking
  })
  .WriteTo.Console()
  .CreateLogger();

Filtering Only

.Filter.WithCerbiGovernanceFiltering(o => { o.Profile = "Orders"; })

Enrichment Only

.Enrich.WithCerbiGovernanceTagging(o => { o.Profile = "Orders"; })

Relaxed Logging

Log.ForContext("userId", "abc123")
   .Relax() // bypass enforcement, tagged GovernanceRelaxed=true
   .Information("Non-compliant log allowed in relax mode");

TagOnlyMode

Use when you want visibility but no blocking (e.g. staging):

o.TagOnlyMode = true;

CI Version Override

Set VERSION env (Directory.Build.props maps it):

dotnet pack ClassLibrary1/Cerbi-Serilog-Governance.csproj -c Release -p:Version=1.2.15

If VERSION is exported (echo "VERSION=1.2.15" >> $GITHUB_ENV) no sed needed.

Benchmarks

A BenchmarkSuite project can exercise hot paths (enricher/filter). Run manually:

dotnet run -c Release -p BenchmarkSuite1/BenchmarkSuite1.csproj

(Only needed for performance investigations.)

Roadmap

  • Caller type / [CerbiTopic] support when runtime exposes evaluation API
  • Structured violation detail enrichment toggle

Contributing

Open issues / PRs. Keep changes minimal & benchmark if performance related.

License

MIT

See Also

  • CerbiStream (integrated governance API)
  • Cerbi.Governance.Runtime (core validator)
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.3.4 34 11/25/2025
1.3.3 45 11/24/2025
1.3.2 44 11/24/2025
1.3.1 50 11/23/2025
1.2.41 35 11/25/2025
1.2.40 46 11/24/2025
1.2.39 42 11/24/2025
1.2.38 42 11/23/2025
1.1.2 212 5/26/2025
1.0.0 186 5/8/2025

v1.3.2: Test reliability improvements - Fixed filter and HTTP tests, added MockHttpMessageHandler, comprehensive publishing documentation.