CerbiStream 1.0.10
See the version list below for details.
dotnet add package CerbiStream --version 1.0.10
NuGet\Install-Package CerbiStream -Version 1.0.10
<PackageReference Include="CerbiStream" Version="1.0.10" />
<PackageVersion Include="CerbiStream" Version="1.0.10" />
<PackageReference Include="CerbiStream" />
paket add CerbiStream --version 1.0.10
#r "nuget: CerbiStream, 1.0.10"
#addin nuget:?package=CerbiStream&version=1.0.10
#tool nuget:?package=CerbiStream&version=1.0.10
CerbiStream Logging Library
CerbiStream is a next-generation logging solution built for structured logs, governance enforcement, and multi-destination routing. It ensures secure, consistent, and high-performance logging for cloud, on-prem, and hybrid environments.
π What's New?
CerbiStream v1.0.9 introduces a modernized, simplified configuration model designed for speed, clarity, and real-world use cases.
π§ Major Improvements
- New Preset Configuration Modes β Easily switch between
DeveloperModeWithTelemetry
,MinimalMode
, orBenchmarkMode
without manually toggling settings. - Cleaner Developer Experience β Legacy
EnableDevMode()
removed in favor of intuitive preset APIs. - Fine-Grained Controls β New methods like
DisableConsoleOutput()
,DisableGovernanceChecks()
, andDisableMetadataInjection()
provide precise control. - Better Benchmarking β
BenchmarkMode()
disables everything unnecessary for micro-benchmark testing. - Telemetry Separation β Decouple telemetry tracking from core logging logic with
EnableTelemetryLogging()
.
These improvements reflect feedback from real production and OSS usageβbalancing governance enforcement with performance and flexibility.
π§° Getting Started
CerbiStream works out-of-the-box. Install, configure, and start logging:
- Install the NuGet package
- Set your queue and enrichment metadata
- Start logging with
ILogger<T>
β For governance enforcement, install the GovernanceAnalyzer.
π¦ Installation
Install CerbiStream from NuGet:
dotnet add package CerbiStream
To enable governance validation:
dotnet add package CerbiStream.GovernanceAnalyzer
βοΈ Preset Config Modes
CerbiStream provides ready-to-use configuration presets:
Method | Description |
---|---|
EnableDeveloperModeWithTelemetry() |
Console + metadata + telemetry (for dev/test) |
EnableDeveloperModeWithoutTelemetry() |
Console + metadata, no telemetry (clean dev logs) |
EnableDevModeMinimal() |
Console only (no metadata or telemetry) for benchmarks or POCs |
EnableBenchmarkMode() |
All silent β disables output, telemetry, metadata, and governance |
π§ Individual Configuration Options
For full control over behavior, you can toggle each capability manually:
Option | Description |
---|---|
DisableConsoleOutput() |
Prevents log messages from appearing in local console |
DisableTelemetryEnrichment() |
Disables automatic telemetry context injection (e.g., ServiceName, etc.) |
DisableMetadataInjection() |
Skips adding common metadata fields (e.g., user type, retry count) |
DisableGovernanceChecks() |
Bypasses governance schema validation on log structure |
IncludeAdvancedMetadata() |
Adds environment/cloud-specific fields like region, version, etc. |
IncludeSecurityMetadata() |
Adds security context fields, if applicable |
SetTelemetryProvider() |
Manually inject a telemetry routing provider |
EnableTelemetryLogging() |
Sends logs to telemetry independently of main log queue |
Use these when building custom setups or combining multiple concerns.
β‘ Quick Start
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using CerbiStream;
var serviceProvider = new ServiceCollection()
.AddLogging(builder =>
{
builder.AddConsole();
builder.AddCerbiStream(options =>
{
options.SetQueue("RabbitMQ", "localhost", "logs-queue");
options.EnableDeveloperModeWithoutTelemetry();
TelemetryContext.ServiceName = "CheckoutService";
TelemetryContext.OriginApp = "MyFrontendApp";
TelemetryContext.UserType = "InternalUser";
});
})
.BuildServiceProvider();
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
logger.LogInformation("App started");
π§ Dev Helper Shortcut
builder.AddDevLogging(); // applies EnableDeveloperModeWithoutTelemetry + telemetry context
π Supported Logging Destinations
Queue Type | Example Value |
---|---|
RabbitMQ | "RabbitMQ" |
Kafka | "Kafka" |
Azure Queue Storage | "AzureQueue" |
Azure Service Bus | "AzureServiceBus" |
AWS SQS | "AWS_SQS" |
AWS Kinesis | "AWS_Kinesis" |
Google Pub/Sub | "GooglePubSub" |
π Automatic Metadata Fields
Field | Auto-Detected? | Example |
---|---|---|
CloudProvider | β | Azure |
Region | β | us-east-1 |
Environment | β | Production |
ApplicationVersion | β | v1.2.3 |
RequestId | β | abc123 |
TransactionType | β | REST |
TransactionStatus | β | Success |
β Telemetry Context Fields
ServiceName
OriginApp
UserType
Feature
IsRetry
RetryAttempt
Set them once and theyβll enrich all logs.
π Retry Tracking Example
Policy
.Handle<Exception>()
.WaitAndRetry(3, _ => TimeSpan.FromSeconds(1), (ex, _, attempt, _) =>
{
TelemetryContext.IsRetry = true;
TelemetryContext.RetryAttempt = attempt;
});
π Governance Enforcement
CerbiStream supports structured logging enforcement via JSON rules. If governance is enabled, logs must match the schema.
{
"LoggingProfiles": {
"SecurityLog": {
"RequiredFields": ["UserId", "IPAddress"],
"OptionalFields": ["DeviceType"]
}
}
}
Use GovernanceAnalyzer to validate rules at build time.
π Telemetry Provider Support
Provider | Supported? |
---|---|
Azure App Insights | β |
AWS CloudWatch | β |
GCP Trace | β |
Datadog | β |
OpenTelemetry (default) | β |
Enable them via:
options.SetTelemetryProvider(new AppInsightsTelemetryProvider());
π Multi-Telemetry Routing
Route different logs to different providers with governance config or custom logic:
{
"TelemetryRouting": {
"SecurityLogs": "Azure",
"InfraLogs": "AWS"
}
}
π§ Why Use CerbiStream?
- β Structured logging & telemetry
- β No PII, ML/AI friendly
- β Preset modes for dev/test/benchmarks
- β Multi-cloud support
- β Enforced governance (optional)
- β
Works with
ILogger<T>
π License: MIT
π£ Want to contribute? Star the repo β, open an issue π, or suggest a feature π§ !
π§βπ» Created by @Zeroshi
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. |
-
net8.0
- AWSSDK.CloudWatchLogs (>= 3.7.410.5)
- AWSSDK.Kinesis (>= 3.7.402.86)
- AWSSDK.SQS (>= 3.7.400.109)
- Azure.Core (>= 1.45.0)
- Azure.Messaging.ServiceBus (>= 7.18.4)
- Azure.Storage.Common (>= 12.23.0-beta.1)
- Azure.Storage.Queues (>= 12.22.0-beta.1)
- cerberus-logger-interface (>= 1.0.26)
- CerbiStream.GovernanceAnalyzer (>= 1.0.1)
- Datadog.Trace (>= 3.12.0)
- Google.Cloud.Logging.V2 (>= 4.4.0)
- Google.Cloud.PubSub.V1 (>= 3.21.0)
- Google.Protobuf (>= 3.30.0)
- Microsoft.ApplicationInsights (>= 2.23.0)
- Microsoft.Extensions.Configuration (>= 9.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0-preview.1.25080.5)
- Moq (>= 4.20.72)
- NUnit (>= 4.3.2)
- OpenTelemetry (>= 1.11.2)
- OpenTelemetry.Exporter.Console (>= 1.11.2)
- RabbitMQ.Client (>= 6.4.0)
- System.Configuration.ConfigurationManager (>= 10.0.0-preview.1.25080.5)
- System.Data.SqlClient (>= 4.9.0)
- System.Diagnostics.EventLog (>= 10.0.0-preview.1.25080.5)
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.1 | 101 | 4/13/2025 |
1.1.0 | 105 | 4/13/2025 |
1.0.16 | 124 | 4/10/2025 |
1.0.15 | 126 | 4/7/2025 |
1.0.14 | 71 | 4/6/2025 |
1.0.13 | 102 | 3/28/2025 |
1.0.12 | 95 | 3/27/2025 |
1.0.11 | 430 | 3/26/2025 |
1.0.10 | 451 | 3/25/2025 |
1.0.9 | 126 | 3/23/2025 |
1.0.8 | 42 | 3/22/2025 |
1.0.7 | 106 | 3/21/2025 |
1.0.6 | 116 | 3/20/2025 |
1.0.5 | 118 | 3/20/2025 |
1.0.4 | 111 | 3/19/2025 |
1.0.3 | 110 | 3/19/2025 |
1.0.2 | 129 | 3/12/2025 |
1.0.1 | 119 | 3/12/2025 |