CerbiStream 1.1.13
See the version list below for details.
dotnet add package CerbiStream --version 1.1.13
NuGet\Install-Package CerbiStream -Version 1.1.13
<PackageReference Include="CerbiStream" Version="1.1.13" />
<PackageVersion Include="CerbiStream" Version="1.1.13" />
<PackageReference Include="CerbiStream" />
paket add CerbiStream --version 1.1.13
#r "nuget: CerbiStream, 1.1.13"
#addin nuget:?package=CerbiStream&version=1.1.13
#tool nuget:?package=CerbiStream&version=1.1.13
CerbiStream: Dev-Friendly, Governance-Enforced Logging for .NET
Brought to you by Cerbi LLC, your trusted partner in enterprise observability.
π View CerbiStream Benchmarks
Compare against Serilog, NLog, and others. CerbiStream is engineered for high performance, strict governance, and enterprise-grade log routing.
π Where can CerbiStream connect? CerbiStream natively supports:
- π¨ Queues: Azure Service Bus, RabbitMQ, Kafka, AWS SQS/Kinesis, Google Pub/Sub
- π HTTP Endpoints: Send logs to any REST API with custom headers
- βοΈ Cloud Storage: Azure Blob Storage (save structured logs for batch processing)
- π File System Fallback: Encrypted JSON file logging when needed
- π Telemetry Providers: App Insights, OpenTelemetry, Datadog, AWS CloudWatch, GCP Stackdriver
Table of Contents
- Overview
- Highlights
- Developer Quick Start
- Advanced Setup & Best Practices
- Features
- Architecture & Implementation
- Preset Modes and Configuration
- Advanced Metadata & Encryption
- Usage Examples
- Integration & Supported Platforms
- Governance and Compliance
- Telemetry Provider Support
- Unit Testing
- Contributing
- Community & Support
- License
π Recent Updates (v1.1.2)
New Features
- Unified Log Enrichment: Every log is decorated with a
LogId
,TimestampUtc
,ApplicationId
,InstanceId
,CloudProvider
,Region
, plus any user metadata. - Payload Encryption: When
EncryptionMode
is set (Base64/AES) and encryption is enabled, the full JSON payload is encrypted before sending. A debug entry logs:_logger.LogDebug($"[CerbiStream] Payload for log ID {logId} encrypted ({options.EncryptionMode}).");
- Metadata Injection: With
EnableMetadataInjection
, every call automatically adds timestamp, log level, and (optionally) encrypts sensitive metadata fields (APIKey
,SensitiveField
, etc.). - Governance Hook: Before sending,
options.ValidateLog(profileName, metadata)
runs any configured governance validator; failures drop the log with an error. - New Backends Added: Out-of-the-box support now includes HTTP endpoint (
HttpMessageSender
) and Azure Blob Storage (BlobStorageSender
)βa highlight of v1.1.2!
Developer Quick Start
Advanced Setup & Best Practices
π View Advanced Setup Guide
Overview
CerbiStream is a high-performance, dev-friendly logging framework for .NET that enforces structured logging governance and flexible encryption. It integrates seamlessly with ILogger<T>
and supports a variety of backends.
Highlights
- High Throughput: Async, queueβfirst architecture minimizes latency.
- Governance Enforced: Schema and field validation via pluggable validators.
- Encryption Options: Base64 or AES encrypt entire JSON payloads.
- Telemetry Integration: Forward events/exceptions/dependencies to App Insights, Datadog, etc.
- Fallback Logging: Optional encrypted file rotation when queues or endpoints are unavailable.
Features
Preset Modes:
EnableDevModeMinimal()
β Console only, no metadata/governance.EnableDeveloperModeWithoutTelemetry()
β Metadata injected, no telemetry.EnableDeveloperModeWithTelemetry()
β Full metadata + telemetry.EnableBenchmarkMode()
β Silent/benchmark mode.
Advanced Metadata Injection:
- Automatic
TimestampUtc
,LogLevel
, plus any custom fields. - Conditional encryption of sensitive fields.
- Automatic
Payload Encryption:
EncryptionType.Base64
orAES
with configurable key/IV.- Debug logs show encryption actions.
Transport Agnostic:
- Queues: RabbitMQ, Kafka, Azure Service Bus, AWS SQS/Kinesis, Google Pub/Sub.
- HTTP: Post JSON logs to any REST endpoint.
- Azure Blob: Store logs as blobs for later processing.
Polly Retries:
- Transparent retry logic for transient failures.
Governance Validator:
- Drop or enrich messages based on organizational policies.
Advanced Metadata & Encryption
Metadata Injection
Enable or disable via:
options.WithMetadataInjection(true);
When enabled, logs include:
TimestampUtc
(UTC time)LogLevel
(string)- Any custom metadata you supply.
Payload Encryption
Configure in CerbiStreamOptions
:
options.WithEncryptionMode(EncryptionType.AES)
.WithEncryptionKey(myKeyBytes, myIvBytes);
When enabled, the entire JSON payload is encrypted before transport, and a debug log indicates this.
Before Encryption
{
"LogId": "abc123",
"LogData": { /* your log entry */ }
}
After Encryption
[ENCRYPTED]<base64-or-aes-payload>[/ENCRYPTED]
Usage Examples
By Environment
Development
var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddCerbiStream(opts => opts.EnableDevModeMinimal());
var app = builder.Build();
app.Run();
Production
var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddCerbiStream(opts => {
opts.WithQueue("RabbitMQ", "amqp://localhost", "logs-queue")
.WithEncryptionMode(EncryptionType.Base64)
.WithMetadataInjection(true)
.EnableDeveloperModeWithoutTelemetry();
});
By Transport
Queues
builder.Logging.AddCerbiStream(opts => {
opts.WithQueue("AzureServiceBus", connectionString, "my-logs")
.WithEncryptionMode(EncryptionType.AES)
.WithEncryptionKey(key, iv)
.WithTelemetryProvider(
TelemetryProviderFactory.CreateTelemetryProvider("appinsights")
)
.WithGovernanceValidator((profile, md) => md.ContainsKey("UserId"))
.EnableDeveloperModeWithTelemetry();
});
HTTP
builder.Services.AddSingleton<ISendMessage>(
new HttpMessageSender("https://logs.myservice.com/ingest", new Dictionary<string,string>{{"x-api-key","secret"}})
);
Blob Storage
builder.Services.AddSingleton<ISendMessage>(
new BlobStorageSender(connectionString, "logs-container")
);
Merged Performance & Exception
var metadata = new Dictionary<string, object> {
["ElapsedMilliseconds"] = 200,
["DependencyCommand"] = "POST /api/order",
["ExceptionMessage"] = ex.Message
};
await logger.LogEventAsync("OrderError", LogLevel.Error, metadata);
Integration & Supported Platforms
Queues: RabbitMQ, Kafka, Azure Service Bus, AWS SQS/Kinesis, Google Pub/Sub.
HTTP Endpoint: Any RESTful API.
Azure Blob Storage: Append logs as JSON blobs.
AutoβDetect Cloud Metadata: CerbiStream inspects these environment variables:
AWS_EXECUTION_ENV
β AWSGOOGLE_CLOUD_PROJECT
β GCPWEBSITE_SITE_NAME
β Azure
These populate CloudProvider
and Region
metadata fields.
Governance and Compliance
- Pluggable Validator:
options.WithGovernanceValidator(...)
to enforce fields. - Static Analysis: Use CerbiStream.GovernanceAnalyzer in your CI:
# .github/workflows/governance.yml name: Governance Validation on: [push, pull_request] jobs: validate-logs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install Analyzer run: dotnet tool install -g CerbiStream.GovernanceAnalyzer - name: Run Analyzer run: cerbi-governance analyze --config cerbi_governance.json
- Azure Marketplace Dashboard: Coming soon β visualize governance metrics in CerbiStream dashboard.
Telemetry Provider Support
Provider | Activation |
---|---|
OpenTelemetry | CreateTelemetryProvider("opentelemetry") |
App Insights | CreateTelemetryProvider("appinsights") |
AWS CloudWatch | CreateTelemetryProvider("awscloudwatch") |
Datadog | CreateTelemetryProvider("datadog") |
GCP Stackdriver | CreateTelemetryProvider("gcpstackdriver") |
Unit Testing
Comprehensive coverage for:
- Payload encryption
- Metadata injection
- Retry logic
- Governance validation
- File fallback rotation
Benchmark vs Serilog
CerbiStream was benchmarked against Serilog to highlight performance, memory usage, and enterprise-readiness.
Category | CerbiStream | Serilog | Comments |
---|---|---|---|
Pipeline Layers | Serialize β Encrypt β Send | Destructure β Enrich β Filter β Format β Write | Serilog's architecture adds overhead per log event. |
Memory Allocation per Event | π΅ ~1β3 KB | π΄ ~10β30 KB | Serilog allocates multiple objects (LogEventProperty trees). |
Encryption Model | Encrypt entire payload | No built-in encryption | CerbiStream secures the full log payload without external libraries. |
Throughput | π’ >50K logs/sec | π ~10Kβ30K logs/sec | CerbiStream maintains speed even with encryption and governance. |
Telemetry & Governance | Native, lightweight, optional enforcement | Plugins required, no native governance | CerbiStream enforces compliance simply. |
Why CerbiStream is Faster
- No Multi-Step Enrichers: Metadata is injected once during serialization.
- Full-Payload Encryption: Encrypts the JSON payload, avoiding per-field cost.
- Minimal Object Allocation: No construction of complex
LogEvent
trees. - Light Retry Strategy: Built-in Polly retries for resilient delivery.
When to Choose CerbiStream
Enterprise-Grade Systems | Lightweight Applications | |
---|---|---|
CerbiStream | β Best choice (performance, compliance, encryption) | β Simple setup, lower resource usage |
Serilog | βοΈ Possible, but heavier and harder to govern | β Best for flexible, custom plug-in scenarios |
View the full benchmarks: CerbiStream Benchmark Tests
License
MIT Β© Cerbi LLC
Contributing
PRs and issues welcome! Please ensure tests pass and follow style guidelines. Use git tag
to list releases.
Community & Support
- GitHub Repo: https://github.com/Zeroshi/Cerbi-CerbiStream
- Email: hello@cerbi.io
- Website & Benchmarks: https://cerbi.io
- Governance Analyzer: https://www.nuget.org/packages/CerbiStream.GovernanceAnalyzer
License
MIT Β© Cerbi LLC
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.1)
- AWSSDK.Kinesis (>= 4.0.2)
- AWSSDK.S3 (>= 4.0.0.1)
- AWSSDK.SQS (>= 4.0.0.1)
- Azure.Core (>= 1.45.0)
- Azure.Messaging.ServiceBus (>= 7.19.0)
- Azure.Storage.Blobs (>= 12.24.0)
- Azure.Storage.Common (>= 12.23.0)
- Azure.Storage.Queues (>= 12.22.0)
- cerberus-logger-interface (>= 1.0.26)
- Datadog.Trace (>= 3.15.0)
- Google.Cloud.Logging.V2 (>= 4.4.0)
- Google.Cloud.PubSub.V1 (>= 3.24.0)
- Google.Cloud.Storage.V1 (>= 4.13.0)
- Google.Protobuf (>= 3.30.2)
- Microsoft.ApplicationInsights (>= 2.23.0)
- Microsoft.Extensions.Configuration (>= 9.0.4)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.4)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.4)
- Moq (>= 4.20.72)
- NUnit (>= 4.3.2)
- OpenTelemetry (>= 1.12.0)
- OpenTelemetry.Exporter.Console (>= 1.12.0)
- Polly (>= 8.5.2)
- RabbitMQ.Client (>= 7.1.2)
- System.Configuration.ConfigurationManager (>= 9.0.4)
- System.Data.SqlClient (>= 4.9.0)
- System.Diagnostics.EventLog (>= 9.0.4)
- System.Security.Cryptography.ProtectedData (>= 9.0.4)
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.19 | 2 | 7/4/2025 |
1.1.18 | 139 | 5/20/2025 |
1.1.17 | 137 | 5/20/2025 |
1.1.16 | 140 | 5/20/2025 |
1.1.15 | 97 | 5/18/2025 |
1.1.14 | 220 | 5/15/2025 |
1.1.13 | 217 | 5/14/2025 |
1.1.12 | 227 | 5/14/2025 |
1.1.11 | 219 | 5/14/2025 |
1.1.10 | 221 | 5/14/2025 |
1.1.9 | 225 | 5/13/2025 |
1.1.8 | 236 | 5/13/2025 |
1.1.7 | 138 | 5/6/2025 |
1.1.6 | 159 | 4/27/2025 |
1.1.5 | 151 | 4/27/2025 |
1.1.3 | 128 | 4/27/2025 |
1.1.2 | 144 | 4/25/2025 |
1.1.1 | 182 | 4/13/2025 |
1.1.0 | 177 | 4/13/2025 |
1.0.16 | 140 | 4/10/2025 |
1.0.15 | 141 | 4/7/2025 |
1.0.14 | 94 | 4/6/2025 |
1.0.13 | 118 | 3/28/2025 |
1.0.12 | 110 | 3/27/2025 |
1.0.11 | 446 | 3/26/2025 |
1.0.10 | 467 | 3/25/2025 |
1.0.9 | 135 | 3/23/2025 |
1.0.8 | 54 | 3/22/2025 |
1.0.7 | 115 | 3/21/2025 |
1.0.6 | 126 | 3/20/2025 |
1.0.5 | 132 | 3/20/2025 |
1.0.4 | 122 | 3/19/2025 |
1.0.3 | 123 | 3/19/2025 |
1.0.2 | 141 | 3/12/2025 |
1.0.1 | 133 | 3/12/2025 |