CerbiStream 1.1.78
dotnet add package CerbiStream --version 1.1.78
NuGet\Install-Package CerbiStream -Version 1.1.78
<PackageReference Include="CerbiStream" Version="1.1.78" />
<PackageVersion Include="CerbiStream" Version="1.1.78" />
<PackageReference Include="CerbiStream" />
paket add CerbiStream --version 1.1.78
#r "nuget: CerbiStream, 1.1.78"
#:package CerbiStream@1.1.78
#addin nuget:?package=CerbiStream&version=1.1.78
#tool nuget:?package=CerbiStream&version=1.1.78
CerbiStream — Governance-Enforced, PII-Safe Logging for .NET
CerbiStream is a governance and safety layer for .NET logging. It validates, redacts, tags, and optionally encrypts logs before they reach any sink.
Keep your existing stack:
Microsoft.Extensions.Logging(MEL)- Serilog
- NLog
- log4net
- OpenTelemetry / OTLP exporters
…and add policy-driven safety, consistency, and ML-ready metadata on top.
🔑 Key Features
Governance rules (runtime enforcement)
- Validate log payloads against a governance profile (
cerbi_governance.json). - Tag events with:
GovernanceViolationsGovernanceProfileVersionGovernanceRelaxed
- Case-insensitive matching for forbidden/disallowed fields.
Redaction
- Automatic in-place redaction of:
DisallowedFields- Fields with severity
Forbidden
- Works on structured payloads so you don’t leak values to downstream sinks.
Runtime validation
- Backed by
Cerbi.Governance.Runtime. - File watcher for hot-reloading governance profiles when
cerbi_governance.jsonchanges. - Consistent behavior across CerbiStream, Cerbi.MEL.Governance, and Serilog/MEL plugins.
Analyzer integration
Pair CerbiStream with Cerbi analyzers to catch issues before runtime:
- Lint for risky fields (e.g.,
password,ssn,creditCard). - Enforce required context and schemas during development.
- Shift PII problems left into CI and IDEs.
Performance
- Allocation-aware adapter:
- Pooled dictionaries for structured state
- Streaming JSON parsing (
Utf8JsonReader) for violation fields
- Minimal “dev mode” & “benchmark mode” for hot-path tuning.
- Benchmarks show parity with established loggers on baseline scenarios.
Encryption
- Optional AES/Base64 encryption for file fallback logs.
- Encrypted file rotation service for:
max sizemax age
- Centralized encryption mode selection via Cerbi options.
ML-ready metadata
- Consistent, structured fields:
GovernanceViolationsGovernanceProfileVersionGovernanceRelaxed- Environment/instance tags
- Makes downstream queries and ML features predictable and repeatable across tools (Loki, Seq, ELK/OpenSearch, Graylog, VictoriaLogs, OpenObserve, etc.).
🤔 Why CerbiStream vs Serilog / NLog / OpenTelemetry?
CerbiStream is not trying to replace Serilog/NLog/OTEL. It’s a governance layer in front of them.
Serilog / NLog / log4net
- Great at structured logging and sink ecosystems.
- Do not enforce:
- Required fields
- Forbidden fields
- Runtime redaction driven by governance profiles
OpenTelemetry (OTEL)
- Great at telemetry pipelines and exporters (OTLP, OTEL Collector, Prometheus, etc.).
- Does not enforce policy-based PII rules on application payloads.
CerbiStream complements these:
- Validates/marks/redacts logs before:
- Serilog sinks
- NLog targets
- OTEL exporters / Collector
- Loki / Seq / ELK / Graylog / VictoriaLogs / OpenObserve / TelemetryHarbor / Fluentd / Alloy / syslog
Use CerbiStream when:
- You need .NET logging governance with explicit profiles and enforcement.
- You must guarantee PII-safe logging before data leaves the process.
- You want runtime validation plus analyzer-time enforcement.
- You prefer safe defaults with opt-in relaxation for diagnostics.
⚡ Quickstart (≤ 60 seconds)
1) Install the package
Install-Package CerbiStream
# or
dotnet add package CerbiStream
2) Add a minimal governance profile cerbi_governance.json
Put this next to your app executable (or adjust configPath):
{
"Version": "1.0.0",
"LoggingProfiles": {
"default": {
"DisallowedFields": [ "ssn", "creditCard" ],
"FieldSeverities": {
"password": "Forbidden"
}
}
}
}
3) Wire CerbiStream into Microsoft.Extensions.Logging
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using CerbiStream.Configuration; // AddCerbiStream / AddCerbiGovernanceRuntime
var host = Host.CreateDefaultBuilder(args)
.ConfigureLogging(logging =>
{
logging.ClearProviders();
logging.AddConsole();
// Option A: Wrap an existing factory with governance runtime
var innerFactory = LoggerFactory.Create(b => b.AddConsole());
logging.AddCerbiGovernanceRuntime(
innerFactory,
profileName: "default",
configPath: "./cerbi_governance.json");
// Option B: Opinionated CerbiStream 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: CerbiStream-driven health + metrics
logging.AddCerbiStreamHealthChecks();
})
.Build();
await host.RunAsync();
4) Log as usual
var logger = host.Services.GetRequiredService<ILogger<Program>>();
logger.LogInformation("User signup", new
{
email = "a@b.com",
ssn = "111-11-1111"
});
CerbiStream will redact disallowed/forbidden fields and add governance tags before any sink sees the event.
🔍 Governance Example: Before vs After
Before (unsafe):
{
"message": "User signup",
"email": "a@b.com",
"ssn": "111-11-1111"
}
After (governed by CerbiStream):
{
"message": "User signup",
"email": "a@b.com",
"ssn": "***REDACTED***",
"GovernanceViolations": [
{ "Code": "ForbiddenField", "Field": "ssn" }
],
"GovernanceProfileVersion": "1.0.0"
}
Opt-in relaxation for intentional diagnostics:
logger.LogInformation("debug payload", new
{
GovernanceRelaxed = true,
dump = secretPayload
});
When GovernanceRelaxed = true and your profile allows relax, CerbiStream skips enforcement/redaction for that entry but still tags it as relaxed for downstream scoring and audit.
🧾 Governance Profile (JSON) Template
{
"Version": "1.0.0",
"LoggingProfiles": {
"default": {
"RequiredFields": [ "message", "timestamp" ],
"ForbiddenFields": [ "password" ],
"DisallowedFields": [ "ssn", "creditCard" ],
"FieldSeverities": {
"password": "Forbidden",
"creditCard": "Forbidden"
},
"SensitiveTags": [ "PII", "Secret" ],
"Encryption": {
"Mode": "AES",
"RotateEncryptedFiles": true
}
}
}
}
Notes:
DisallowedFieldsand any field with severityForbiddenwill be redacted.RequiredFieldsare validated and surfaced as violations when missing.- Profiles are just JSON – keep them in Git, and let Cerbi’s file watcher hot-reload changes.
📈 Performance
CerbiStream includes a Benchmark & Evaluation suite that compares it to:
- Microsoft.Extensions.Logging (MEL)
- Serilog
- NLog
- log4net
Baseline summary (Release, .NET 8, no-op sinks):
| Scenario | Relative throughput |
|---|---|
| Baseline (MEL console) | 1.00x |
| Serilog console | 0.95x–1.05x |
| NLog console | 0.90x–1.00x |
| CerbiStream + console | ~0.90x–0.98x |
What makes it fast:
Allocation-aware adapter with:
- Pooled
Dictionary<string, object> - Pooled
HashSet<string>
- Pooled
Streaming parse of governance metadata via
Utf8JsonReaderImmediate short-circuit when
GovernanceRelaxedis set
Run the repo’s benchmarks:
- Windows:
scripts/bench.ps1 - Linux/macOS:
scripts/bench.sh - Or directly:
dotnet run --project Cerbi-Benchmark-Tests/Cerbi-Benchmark-Tests.csproj -c Release
For full benchmark commentary, see the CerbiStream Benchmark & Evaluation Suite README in this repo.
🔗 Integration Patterns
MEL Primary integration via
AddCerbiStream/AddCerbiGovernanceRuntime.Serilog Wrap your Serilog-backed
ILoggerFactoryso Cerbi governance runs before Serilog sinks.NLog / log4net Integrate via MEL or by routing governed events into existing targets.
OpenTelemetry Use CerbiStream in the app, then export via OTLP to the OTEL Collector. Logs arrive already governed/redacted.
Azure Container Apps (ACA) / Kubernetes CerbiStream is fully compatible with containerized .NET apps:
- Environment variables: Set
CERBI_GOVERNANCE_PATH=/app/config/cerbi_governance.jsonto override the default location. - ConfigMaps / Volumes: Mount your governance profile as a read-only volume; the library's
FileSystemWatchergracefully degrades on read-only mounts, falling back to timestamp-based reload checks. - AppContext.BaseDirectory: Falls back to
./cerbi_governance.jsonnext to the app executable whenCERBI_GOVERNANCE_PATHis not set. - Performance: Pooled dictionaries, HashSets, and streaming JSON parsing ensure minimal allocation overhead at high throughput.
- Health checks: Use
AddCerbiStreamHealthChecks()to expose/cerbistream/healthand/cerbistream/metricsendpoints for ACA/K8s probes.
Example for ACA deployment:
containers: - name: myapp image: myregistry.azurecr.io/myapp:latest env: - name: CERBI_GOVERNANCE_PATH value: "/app/config/cerbi_governance.json" volumeMounts: - name: governance-config mountPath: /app/config readOnly: true volumes: - name: governance-config secret: secretName: cerbi-governance- Environment variables: Set
Downstream stacks CerbiStream plays nicely with:
- Grafana Loki / Promtail / Alloy
- Seq
- ELK / OpenSearch
- Graylog
- VictoriaLogs / VictoriaMetrics
- OpenObserve
- TelemetryHarbor
- Fluentd / Fluent Bit
- Journald / basic syslog + grep/tail
You don't need a CerbiStream.Fluentd or CerbiStream.Alloy NuGet package. You need: CerbiStream in-process, plus configuration for your collector/exporter to ingest those governed logs.
❓ FAQ
Does this replace Serilog or NLog? No. CerbiStream is a governance layer, not a sink library. Keep Serilog/NLog/OTEL; add CerbiStream to enforce profiles and redaction before events flow into those stacks.
What about performance overhead? CerbiStream is designed to be competitive with top loggers. Baseline cost is close to raw MEL; governance/redaction cost is explicit and measurable in the included benchmarks.
What happens when governance is disabled or relaxed?
When disabled, CerbiStream behaves like a thin pass-through provider.
When
GovernanceRelaxed = true, enforcement is skipped for that entry:- No redaction
- Event is tagged as relaxed for downstream scoring
Can I manage governance profiles centrally? Yes. Profiles can be generated and deployed via CerbiShield (governance dashboard) and consumed by CerbiStream, MEL plugins, and Serilog governance adapters.
✅ Call to Action
⭐ Star the repo if CerbiStream helps keep your logs safe and compliant.
🧪 Use it side-by-side with your existing logger to evaluate governance impact.
💬 Open issues for:
- Additional examples (Fluentd, Alloy, Loki, OTEL Collector configs)
- Feature requests
- Benchmark scenarios you care about
📚 Appendix: .NET Logging Governance Topics (SEO)
- .NET logging governance
- PII-safe logging for .NET
- Runtime log redaction for C#
- Policy-driven structured logging
- Governance profiles for Serilog, NLog, MEL
- OpenTelemetry logging with PII enforcement
- OTEL Collector with governed logs
- AES-encrypted log files for .NET
- CerbiStream vs Serilog vs NLog vs log4net
| 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.78 | 36 | 11/25/2025 |
| 1.1.77 | 178 | 11/22/2025 |
| 1.1.76 | 172 | 11/22/2025 |
| 1.1.75 | 172 | 11/22/2025 |
| 1.1.74 | 154 | 11/15/2025 |
| 1.1.73 | 163 | 11/15/2025 |
| 1.1.72 | 173 | 10/30/2025 |
| 1.1.71 | 175 | 10/30/2025 |
| 1.1.70 | 180 | 10/27/2025 |
| 1.1.69 | 163 | 10/27/2025 |
| 1.1.67 | 107 | 10/24/2025 |
| 1.1.66 | 108 | 10/24/2025 |
| 1.1.65 | 113 | 10/24/2025 |
| 1.1.64 | 117 | 10/24/2025 |
| 1.1.63 | 119 | 10/24/2025 |
| 1.1.62 | 112 | 10/24/2025 |
| 1.1.61 | 125 | 10/24/2025 |
| 1.1.60 | 119 | 10/24/2025 |
| 1.1.59 | 127 | 10/24/2025 |
| 1.1.58 | 160 | 10/24/2025 |
| 1.1.57 | 180 | 9/9/2025 |
| 1.1.55 | 171 | 9/7/2025 |
| 1.1.54 | 148 | 9/7/2025 |
| 1.1.19 | 119 | 7/4/2025 |
| 1.1.18 | 192 | 5/20/2025 |
| 1.1.17 | 193 | 5/20/2025 |
| 1.1.16 | 198 | 5/20/2025 |
| 1.1.15 | 163 | 5/18/2025 |
| 1.1.14 | 272 | 5/15/2025 |
| 1.1.13 | 280 | 5/14/2025 |
| 1.1.12 | 281 | 5/14/2025 |
| 1.1.11 | 280 | 5/14/2025 |
| 1.1.10 | 271 | 5/14/2025 |
| 1.1.9 | 264 | 5/13/2025 |
| 1.1.8 | 300 | 5/13/2025 |
| 1.1.7 | 192 | 5/6/2025 |
| 1.1.6 | 236 | 4/27/2025 |
| 1.1.5 | 206 | 4/27/2025 |
| 1.1.3 | 191 | 4/27/2025 |
| 1.1.2 | 205 | 4/25/2025 |
| 1.1.1 | 252 | 4/13/2025 |
| 1.1.0 | 218 | 4/13/2025 |
| 1.0.16 | 181 | 4/10/2025 |
| 1.0.15 | 179 | 4/7/2025 |
| 1.0.14 | 135 | 4/6/2025 |
| 1.0.13 | 162 | 3/28/2025 |
| 1.0.12 | 144 | 3/27/2025 |
| 1.0.11 | 483 | 3/26/2025 |
| 1.0.10 | 502 | 3/25/2025 |
| 1.0.9 | 176 | 3/23/2025 |
| 1.0.8 | 92 | 3/22/2025 |
| 1.0.7 | 160 | 3/21/2025 |
| 1.0.6 | 170 | 3/20/2025 |
| 1.0.5 | 175 | 3/20/2025 |
| 1.0.4 | 158 | 3/19/2025 |
| 1.0.3 | 164 | 3/19/2025 |
| 1.0.2 | 179 | 3/12/2025 |
| 1.0.1 | 175 | 3/12/2025 |
See docs/RELEASE-NOTES.md