CerbiStream 1.1.72
dotnet add package CerbiStream --version 1.1.72
NuGet\Install-Package CerbiStream -Version 1.1.72
<PackageReference Include="CerbiStream" Version="1.1.72" />
<PackageVersion Include="CerbiStream" Version="1.1.72" />
<PackageReference Include="CerbiStream" />
paket add CerbiStream --version 1.1.72
#r "nuget: CerbiStream, 1.1.72"
#:package CerbiStream@1.1.72
#addin nuget:?package=CerbiStream&version=1.1.72
#tool nuget:?package=CerbiStream&version=1.1.72
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.jsonto .NET9 (9.0.x, rollForward=latestFeature, allowPrerelease=true). Plan to bump to10.0.100post-GA. - C# language version centralized to
latestandNullableis enabled viaDirectory.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:
AddCerbiStreamconvenience registrationOverloads:
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
IEncryptionviaEncryptionFactorybased on options.HealthHostedServiceTiny hosted service that checks for presence/accessibility of the governance policy file at startup and logs warnings/info.
Telemetry & metadata helpers
TelemetryContextsnapshot 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 asGovernanceRelaxed(bypass enforcement) for intentional diagnostics.Performance-friendly runtime changes
Governance adapter pools temporary
Dictionary<string, object>andHashSet<string>to reduce allocations.Streaming parsing of JSON-formatted
GovernanceViolationsviaUtf8JsonReader.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) orscripts/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,ViolationsinCerbiStream.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
MicroHarnessconsole 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()andUseCerbiStreamMetrics().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.jsonpolicy 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)
- Add the project reference to
LoggingStandards/CerbiStream.csproj(or install the NuGet package). - Create a policy file
cerbi_governance.jsonin your app folder or setCERBI_GOVERNANCE_PATH.
Example policy snippet:
{
"Version": "1.0.0",
"LoggingProfiles": {
"default": {
"DisallowedFields": ["ssn"],
"FieldSeverities": { "creditCard": "Forbidden" }
}
}
}
- 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"));
});
- Run. Logs that include
ssnorcreditCardfields 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 viaCERBI_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 useMicroHarnessfor 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.ymlbuilds 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 | 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
- AWSSDK.CloudWatchLogs (>= 4.0.7.7)
- AWSSDK.Kinesis (>= 4.0.4.1)
- AWSSDK.S3 (>= 4.0.6.13)
- AWSSDK.SQS (>= 4.0.1.2)
- Azure.Core (>= 1.47.3)
- Azure.Messaging.ServiceBus (>= 7.20.1)
- Azure.Storage.Blobs (>= 12.25.0)
- Azure.Storage.Common (>= 12.24.0)
- Azure.Storage.Queues (>= 12.23.0)
- cerberus-logger-interface (>= 1.0.26)
- Cerbi.Governance.Core (>= 1.0.2)
- Cerbi.Governance.Runtime (>= 1.1.1)
- Datadog.Trace (>= 3.25.0)
- Google.Cloud.Logging.V2 (>= 4.4.0)
- Google.Cloud.PubSub.V1 (>= 3.27.0)
- Google.Cloud.Storage.V1 (>= 4.13.0)
- Google.Protobuf (>= 3.32.0)
- Microsoft.ApplicationInsights (>= 2.23.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration (>= 9.0.8)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.8)
- OpenTelemetry (>= 1.12.0)
- OpenTelemetry.Exporter.Console (>= 1.12.0)
- Polly (>= 8.6.3)
- RabbitMQ.Client (>= 7.1.2)
- System.Configuration.ConfigurationManager (>= 9.0.8)
- System.Data.SqlClient (>= 4.9.0)
- System.Diagnostics.EventLog (>= 9.0.8)
- System.Security.Cryptography.ProtectedData (>= 9.0.8)
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