CerbiStream 1.1.72

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

CerbiStream — Governance-Enforced Structured Logging for .NET

CerbiStream helps teams produce safe, standardized, and ML-ready logs. It enforces governance policies at runtime (redaction, tagging, validation) before logs reach any sink, while integrating with existing logging frameworks such as Microsoft.Extensions.Logging and Serilog.

This README is ordered for new users: quick overview, why it matters, how to get started, key features, integrations, performance, security & compliance, docs and troubleshooting, and value props.


SDK & Language

  • SDK pinned via global.json to .NET9 (9.0.x, rollForward=latestFeature, allowPrerelease=true). Plan to bump to 10.0.100 post-GA.
  • C# language version centralized to latest and Nullable is enabled via Directory.Build.props.
  • Target frameworks are unchanged; library and apps continue to target net8.0.

Quick summary (What is CerbiStream?)

  • A runtime logging layer that validates, tags, and redacts structured logs according to a policy.
  • Works as a wrapper around your existing logging pipeline (MEL, Serilog adapters available).
  • Keeps logging fast and consistent for downstream analytics and ML.

Developer-friendly additions (recent)

Enabled by default or via simple options:

  • AddCerbiStream convenience registration

  • Overloads:

  • AddCerbiStream(this ILoggingBuilder, Action<CerbiStreamOptions>) — configure via fluent options.

  • AddCerbiStream(this ILoggingBuilder) — opinionated defaults.

  • Registers CerbiStreamOptions, CerbiStreamLoggerProvider, RuntimeGovernanceValidator, health helper, and (when configured) file fallback + rotation.

  • Registers IEncryption via EncryptionFactory based on options.

  • HealthHostedService

  • Tiny hosted service that checks for presence/accessibility of the governance policy file at startup and logs warnings/info.

  • Telemetry & metadata helpers

  • TelemetryContext snapshot facility and enrichment in adapters when enabled.

  • Lightweight enrichment of tracing identifiers (TraceId, SpanId) when tracing enrichment is on.

  • Relaxed logging helper

  • logger.Relax() wrapper allows marking specific logs as GovernanceRelaxed (bypass enforcement) for intentional diagnostics.

  • Performance-friendly runtime changes

  • Governance adapter pools temporary Dictionary<string, object> and HashSet<string> to reduce allocations.

  • Streaming parsing of JSON-formatted GovernanceViolations via Utf8JsonReader.

  • The governance logger provider now uses a fresh dictionary for structured state to ensure sinks can safely read/redact state.

  • Tests

  • Unit tests cover options, governance behaviors, telemetry providers, health hosted service, and wiring integration.

Quick usage example (recommended):

var host = Host.CreateDefaultBuilder(args)
 .ConfigureLogging(logging =>
 {
 logging.ClearProviders();
 logging.AddConsole();

 // Option A: Governance wrapper over an inner factory (keeps your sinks there)
 var innerFactory = LoggerFactory.Create(b => b.AddConsole());
 logging.AddCerbiGovernanceRuntime(innerFactory, profileName: "default", configPath: "./cerbi_governance.json");

 // Option B: Opinionated registration with options
 logging.AddCerbiStream(options =>
 {
 options
 .WithFileFallback("logs/fallback.json", "logs/primary.json")
 .WithAesEncryption()
 .WithEncryptionKey(
 System.Text.Encoding.UTF8.GetBytes("1234567890123456"),
 System.Text.Encoding.UTF8.GetBytes("1234567890123456"))
 .WithGovernanceChecks(true)
 .WithTelemetryEnrichment(true);
 });

 // Optional: health + metrics middleware for ASP.NET Core
 logging.AddCerbiStreamHealthChecks();
 })
 .Build();

This wires CerbiStream into the standard host logging system and registers the health check hosted service automatically. If encryption is enabled, the encrypted file rotation hosted service is registered too.

Run unit tests locally:

dotnet test CerbiStream--UnitTests/UnitTests.csproj -f net8.0

Re-baseline locally (build, tests, benchmarks):

  • Build: dotnet build -c Release
  • Test: dotnet test -c Release
  • Benchmarks: scripts/bench.sh (Linux/macOS) or scripts/bench.ps1 (Windows)

Install from NuGet:

dotnet add package CerbiStream --version 1.1.20

Dev & observability (new)

CerbiStream aims to be developer-friendly and lightweight.

  • Built-in metrics

  • Lightweight counters: LogsProcessed, Redactions, Violations in CerbiStream.Observability.Metrics.

  • Thread-safe; reset in tests via Metrics.Reset().

  • When a telemetry provider is configured, basic metric events can be forwarded.

  • Micro-harness for profiling

  • MicroHarness console app exercises the governance logger in a tight loop without BenchmarkDotNet to collect focused profiler traces.

  • Prometheus / health endpoints (opt-in)

  • Minimal middleware exposes:

  • /cerbistream/metrics — Prometheus-style plaintext metrics.

  • /cerbistream/health — basic JSON readiness.

  • Enable in ASP.NET Core with AddCerbiStreamHealthChecks() and UseCerbiStreamMetrics().

  • Keep it lightweight

  • Everything above is opt-in. The core library has no runtime dependency on ASP.NET Core; middleware uses optional registration.


The problem (why this exists)

Modern apps emit high volumes of structured logs across many services and destinations. Common challenges:

  • PII and secrets accidentally logged and stored in multiple systems.
  • Inconsistent field names and schemas break analytics & ML pipelines.
  • Compliance audits require consistent redaction and proof of enforcement.
  • Storing unstandardized logs increases indexing and storage costs.

The solution (what CerbiStream does)

CerbiStream enforces governance before logs are written to any sink:

  • Validates logs against a cerbi_governance.json policy per profile.
  • Tags logs with governance metadata (violations, profile version).
  • Redacts disallowed/forbidden fields in-place.
  • Integrates seamlessly with existing sinks and logging libraries.

Quick start (5-minute setup)

  1. Add the project reference to LoggingStandards/CerbiStream.csproj (or install the NuGet package).
  2. Create a policy file cerbi_governance.json in your app folder or set CERBI_GOVERNANCE_PATH.

Example policy snippet:

{
 "Version": "1.0.0",
 "LoggingProfiles": {
 "default": {
 "DisallowedFields": ["ssn"],
 "FieldSeverities": { "creditCard": "Forbidden" }
 }
 }
}
  1. Wire into your logging pipeline:
var inner = LoggerFactory.Create(b => b.AddConsole());
builder.Logging.AddCerbiGovernanceRuntime(inner, "default", configPath: "./cerbi_governance.json");

OR use the convenience helper:

builder.Logging.AddCerbiStream(options =>
{
 options.WithFileFallback("logs/fallback.json", "logs/primary.json");
 // To enable encryption and rotation:
 options.WithAesEncryption()
 .WithEncryptionKey(
 System.Text.Encoding.UTF8.GetBytes("1234567890123456"),
 System.Text.Encoding.UTF8.GetBytes("1234567890123456"));
});
  1. Run. Logs that include ssn or creditCard fields will be redacted as ***REDACTED*** and governance tags will be present.

For more: see docs/INSTALLATION.md and docs/README-PRODUCTION.md.


Key features (at a glance)

  • Runtime governance enforcement (validate, tag, redact)
  • Profile-based policies (LoggingProfiles) and env override via CERBI_GOVERNANCE_PATH
  • In-place, case-insensitive redaction for structured logs
  • Relaxed mode (GovernanceRelaxed) to bypass enforcement when intentional
  • Low-latency with allocation-conscious internals (adapter pooling and streaming parsing)
  • Integrations with AppInsights, OpenTelemetry, Datadog, AWS CloudWatch, GCP Stackdriver
  • Queue + storage sinks: Azure, AWS SQS/Kinesis/S3, Google Pub/Sub/Storage, RabbitMQ, Kafka
  • File fallback with optional encryption (AES/Base64) and rotation
  • Configurable retry policies and telemetry enrichment
  • Unit tests and benchmark suite included (CerbiStream--UnitTests, BenchmarkSuite1, MicroHarness)

Performance & benchmark notes

  • Baseline (no governance): in-memory no-op sink is near-constant time.
  • Governance path (validation + redaction): microsecond-range on typical hardware.
  • Benchmarks are in BenchmarkSuite1. You can also use MicroHarness for focused profiling without harness overhead.

Security & compliance

  • Policies should be stored and changed via PRs and restricted permissions.
  • Redaction is applied at ingestion to reduce exposure.
  • Audit fields (GovernanceViolations, GovernanceProfileVersion) aid compliance.
  • Encryption support (AES/Base64) for file fallback and optional payload encryption.

Packaging & CI

  • NuGet packaging metadata is in LoggingStandards/CerbiStream.csproj.
  • GitHub Actions workflow .github/workflows/build-and-test.yml builds and runs tests on push/PR.

FAQ (short)

Q: Does CerbiStream replace Serilog or MEL? A: No. CerbiStream is a governance/enrichment layer that plugs into MEL/Serilog.

Q: What if policy changes frequently? A: The adapter watches the policy file and reloads safely; for remote sources implement a custom provider.

Q: What if I need zero-latency logging? A: Consider bypass/relaxed flows or background validation depending on requirements.


Documentation & support

  • Installation & quick start: docs/INSTALLATION.md
  • Production guidance & checklist: docs/README-PRODUCTION.md
  • Troubleshooting: docs/TROUBLESHOOTING.md
  • Technical walkthrough: docs/WALKTHROUGH-TECHNICAL.md
  • Non-technical overview: docs/OVERVIEW-NONTECHNICAL.md

Contributing

Contributions are welcome. Please follow existing code style, add tests, and run the benchmark suite when changing hot paths.

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.72 106 10/30/2025
1.1.71 108 10/30/2025
1.1.70 161 10/27/2025
1.1.69 150 10/27/2025
1.1.67 99 10/24/2025
1.1.66 102 10/24/2025
1.1.65 107 10/24/2025
1.1.64 111 10/24/2025
1.1.63 112 10/24/2025
1.1.62 103 10/24/2025
1.1.61 115 10/24/2025
1.1.60 110 10/24/2025
1.1.59 117 10/24/2025
1.1.58 152 10/24/2025
1.1.57 175 9/9/2025
1.1.55 168 9/7/2025
1.1.54 139 9/7/2025
1.1.19 112 7/4/2025
1.1.18 184 5/20/2025
1.1.17 187 5/20/2025
1.1.16 192 5/20/2025
1.1.15 158 5/18/2025
1.1.14 266 5/15/2025
1.1.13 275 5/14/2025
1.1.12 276 5/14/2025
1.1.11 275 5/14/2025
1.1.10 266 5/14/2025
1.1.9 260 5/13/2025
1.1.8 294 5/13/2025
1.1.7 186 5/6/2025
1.1.6 228 4/27/2025
1.1.5 202 4/27/2025
1.1.3 181 4/27/2025
1.1.2 199 4/25/2025
1.1.1 244 4/13/2025
1.1.0 215 4/13/2025
1.0.16 178 4/10/2025
1.0.15 170 4/7/2025
1.0.14 128 4/6/2025
1.0.13 156 3/28/2025
1.0.12 140 3/27/2025
1.0.11 479 3/26/2025
1.0.10 498 3/25/2025
1.0.9 170 3/23/2025
1.0.8 87 3/22/2025
1.0.7 152 3/21/2025
1.0.6 164 3/20/2025
1.0.5 172 3/20/2025
1.0.4 155 3/19/2025
1.0.3 160 3/19/2025
1.0.2 173 3/12/2025
1.0.1 170 3/12/2025

See docs/RELEASE-NOTES.md