Cerbi.Serilog.GovernanceAnalyzer
1.2.39
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
<PackageReference Include="Cerbi.Serilog.GovernanceAnalyzer" Version="1.2.39" />
<PackageVersion Include="Cerbi.Serilog.GovernanceAnalyzer" Version="1.2.39" />
<PackageReference Include="Cerbi.Serilog.GovernanceAnalyzer" />
paket add Cerbi.Serilog.GovernanceAnalyzer --version 1.2.39
#r "nuget: Cerbi.Serilog.GovernanceAnalyzer, 1.2.39"
#:package Cerbi.Serilog.GovernanceAnalyzer@1.2.39
#addin nuget:?package=Cerbi.Serilog.GovernanceAnalyzer&version=1.2.39
#tool nuget:?package=Cerbi.Serilog.GovernanceAnalyzer&version=1.2.39
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 | Versions 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. |
-
net8.0
- Cerbi.Governance.Core (>= 1.0.2)
- Cerbi.Governance.Runtime (>= 1.1.1)
- Serilog (>= 4.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v1.3.2: Test reliability improvements - Fixed filter and HTTP tests, added MockHttpMessageHandler, comprehensive publishing documentation.