Cerbi.MEL.Governance 1.0.28

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

Cerbi.MEL.Governance (In Development)

Real-time logging governance enforcement for Microsoft.Extensions.Logging (MEL) using the Cerbi validation engine.

🚧 Note: Cerbi.MEL.Governance is currently under active development. We’ve been thrilled—and a bit surprised—by nearly 2,000 downloads in just a few days since this was quietly released. Thank you for your patience and feedback as we continue improving this project!

Cerbi.MEL.Governance is part of the Cerbi suite. It enables runtime validation of log fields based on structured governance profiles. Built for ASP.NET Core, Worker Services, Azure Functions, and any .NET app using Microsoft.Extensions.Logging.


🚀 Features (Current Scope)

  • ✅ Enforce required and forbidden fields
  • ✅ Drop or tag logs with governance violations
  • ✅ Supports structured logging and BeginScope
  • ✅ Supports [CerbiTopic("...")] profile routing via caller class detection (injected CerbiTopic field)
  • ✅ Compatible with any MEL-compatible sink (Console, File, Seq, etc.)

⚠️ Note: “Relaxed mode” (AllowRelax) can be toggled via configuration and will mark entries as relaxed when a structured Relax = true field is provided. A dedicated Relax() helper method is not available in this release but may be introduced in a future version.


📆 Installation

dotnet add package Cerbi.MEL.Governance

🛠 Setup

1. Add a governance config file

{
  "EnforcementMode": "Strict",
  "LoggingProfiles": {
    "Orders": {
      "FieldSeverities": {
        "userId": "Required",
        "email": "Required",
        "password": "Forbidden"
      },
      "AllowRelax": true,
      "RequireTopic": true,
      "AllowedTopics": ["Orders"]
    }
  }
}

Save this as cerbi_governance.json in your project root.

2. Configure MEL to use Cerbi governance

using Microsoft.Extensions.Logging;
using Cerbi.MEL.Governance;

builder.Logging.AddCerbiGovernance(options =>
{
    options.Profile = "Orders";      // default fallback topic
    options.ConfigPath = "cerbi_governance.json";
    options.Enabled = true;            // enable or disable governance at runtime
});

🔹 Optional: Use [CerbiTopic("...")] to route logs to specific profiles

[CerbiTopic("Orders")]
public class OrderService
{
    private readonly ILogger<OrderService> _logger;

    public OrderService(ILogger<OrderService> logger)
    {
        _logger = logger;
    }

    public void Process()
    {
        _logger.LogInformation("Order processed for {userId}", "abc123");
    }
}

✅ The [CerbiTopic] attribute automatically injects a CerbiTopic field at runtime. Logs emitted from this class will be validated against the "Orders" profile.


✍️ Example Logging

_logger.LogInformation("User info: {userId} {email}", "abc123", "test@example.com");

// Missing userId → governance violation under "Orders"
_logger.LogInformation("Only email provided: {email}", "test@example.com");

// Forbidden field (password) → governance violation under "Orders"
_logger.LogInformation("Password in log: {userId} {email} {password}", "abc123", "test@example.com", "secret");

// Relaxed example (when AllowRelax = true in config):
_logger.LogInformation("Email-only (relaxed): {email} {Relax}", "user@example.com", true);

🧐 Governance Output

When governance enrichment is enabled, the plugin appends a JSON payload containing governance fields. Examples:

  1. Violation example (missing required field):
{
  "GovernanceProfileUsed": "Orders",
  "GovernanceViolations": ["MissingField:userId"],
  "GovernanceRelaxed": false
}
  1. Forbidden field example:
{
  "GovernanceProfileUsed": "Orders",
  "GovernanceViolations": ["ForbiddenField:password"],
  "GovernanceRelaxed": false
}
  1. Relaxed example (AllowRelax = true, Relax=true passed):
{
  "email": "user@example.com",
  "CerbiTopic": "Orders",
  "GovernanceRelaxed": true,
  "GovernanceProfileUsed": "Orders"
}

SBOM & Compliance

Cerbi.MEL.Governance is safe for use in secure logging pipelines. No outbound calls. MIT licensed. All governance logic is internal and validated at runtime.


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.0.37 153 6/5/2025
1.0.35 141 6/4/2025
1.0.34 132 6/4/2025
1.0.33 140 6/4/2025
1.0.32 147 6/4/2025
1.0.31 97 6/1/2025
1.0.30 102 6/1/2025
1.0.29 97 6/1/2025
1.0.28 109 5/31/2025
1.0.27 106 5/31/2025
1.0.26 105 5/31/2025
1.0.25 102 5/31/2025
1.0.24 101 5/31/2025
1.0.23 106 5/31/2025
1.0.22 71 5/31/2025
1.0.21 79 5/31/2025
1.0.20 76 5/31/2025
1.0.19 71 5/31/2025
1.0.18 69 5/31/2025
1.0.17 72 5/30/2025
1.0.16 70 5/30/2025
1.0.15 151 5/27/2025
1.0.14 141 5/27/2025
1.0.13 142 5/27/2025
1.0.12 151 5/26/2025
1.0.11 145 5/26/2025
1.0.10 143 5/26/2025
1.0.9 151 5/26/2025
1.0.8 152 5/26/2025
1.0.7 148 5/26/2025
1.0.6 145 5/26/2025
1.0.5 145 5/26/2025
1.0.4 147 5/26/2025
1.0.3 150 5/26/2025
1.0.2 148 5/26/2025
1.0.1 143 5/26/2025
1.0.0 146 5/26/2025