CerbiStream 1.0.16
dotnet add package CerbiStream --version 1.0.16
NuGet\Install-Package CerbiStream -Version 1.0.16
<PackageReference Include="CerbiStream" Version="1.0.16" />
<PackageVersion Include="CerbiStream" Version="1.0.16" />
<PackageReference Include="CerbiStream" />
paket add CerbiStream --version 1.0.16
#r "nuget: CerbiStream, 1.0.16"
#addin nuget:?package=CerbiStream&version=1.0.16
#tool nuget:?package=CerbiStream&version=1.0.16
CerbiStream: Dev-Friendly, Governance-Enforced Logging for .NET
đ View CerbiStream Benchmarks
Compare against Serilog, NLog, and others. CerbiStream is engineered for high performance, strict governance, and enterprise-grade log routing.
Table of Contents
- Overview
- Highlights
- Features
- Architecture & Implementation
- Preset Modes and Configuration
- Usage Examples
- Integration & Supported Platforms
- Governance and Compliance
- Telemetry Provider Support
- Unit Testing
- Cerbi Suite: The Bigger Picture
- Contributing
- License
Overview
CerbiStream is a high-performance, dev-friendly logging framework for .NET that not only emphasizes low latency and high throughput but also enforces structured logging governance. Designed for modern applications using ILogger<T>
, CerbiStream integrates seamlessly into ASP.NET Core, Blazor, and Entity Framework projects. Its flexible configuration options and robust governance support make it ideal for both development and enterprise-scale deployments.
CerbiStream is a core component of the Cerbi Suiteâa set of tools designed for observability, log governance, routing, and telemetry in regulated and performance-critical environments.
Highlights
Dev-Friendly & Flexible:
Works out of the box with .NET Coreâs logging abstractions.High Performance:
Engineered for low latency and high throughput with efficient resource usage even when logs are output in realistic development modes.Governance-Enforced Logging:
Ensures logs conform to structured formats and compliance requirements via internal or pluggable governance validators.Multiple Integration Options:
Supports RabbitMQ, Kafka, Azure Service Bus, AWS SQS/Kinesis, and Google Pub/Sub.Encryption & Security:
Offers flexible encryption modesâincluding Base64 and AESâto secure sensitive logging data.Queue-First Architecture:
Decouples log generation from delivery, enhancing resilience and scalability via the CerbIQ routing component.Telemetry & Analytics:
Built-in support for telemetry providers (OpenTelemetry, Azure App Insights, AWS CloudWatch, etc.) for end-to-end observability.
Features
Developer Modes:
- EnableDevModeMinimal(): Minimal console logging without metadata injectionâperfect for lightweight development debugging.
- EnableDeveloperModeWithoutTelemetry(): Console logging with metadata injection but no telemetry data.
- EnableDeveloperModeWithTelemetry(): Full-fledged logging with metadata, telemetry, and governance checks.
- EnableBenchmarkMode(): A silent mode disabling all outputs, enrichers, and telemetry, ideal for performance measurement.
Governance Enforcement:
Use built-in or externally provided validators (via the CerbiStream.GovernanceAnalyzer or custom hooks) to enforce required log fields and format consistency.Encryption Options:
Configure encryption modes to secure log data with options for None, Base64, or AES encryption.Queue-First, Sink-Agnostic Logging:
Route logs through configured messaging queues first for enhanced fault tolerance and delayed sink processing via CerbIQ.Telemetry Integration:
Out-of-the-box support for major telemetry platforms ensures your log data is immediately useful for observability and diagnostics.
Architecture & Implementation
CerbiStreamâs architecture is designed to maximize logging performance while ensuring compliance and structured data integrity:
Asynchronous Processing:
The logging pipeline is built using modern asynchronous patterns to avoid blocking I/O. This allows high-volume log generation without impacting application performance.Queue-First Model:
Log events are first enqueued (supporting various messaging systems) before being dispatched to the final sink. This decoupling reduces processing spikes and improves reliability.Modular & Configurable:
The framework uses a fluent API for configuration, letting you easily switch modes, enable encryption, set up telemetry, and plug in custom governance validators.Governance & Validation:
A key aspect of CerbiStream is its governance engine, which enforces structured logging policies. Whether integrated via CerbiStream.GovernanceAnalyzer or custom logic, it ensures that all log messages meet your organizational standards.Performance Modes:
Different preset modes (Benchmark, Developer Modes) allow you to choose the level of output and enrichment based on your environmentâfrom raw performance testing to full-featured dev logging.
Preset Modes and Configuration
Developer Modes
EnableDevModeMinimal()
Minimal logging output to the console without metadata or governance checks.builder.Logging.AddCerbiStream(options => options.EnableDevModeMinimal());
EnableDeveloperModeWithoutTelemetry()
Console logging with metadata injection but without telemetry.builder.Logging.AddCerbiStream(options => options.EnableDeveloperModeWithoutTelemetry());
EnableDeveloperModeWithTelemetry()
Full developer mode with metadata enrichment and telemetry.builder.Logging.AddCerbiStream(options => options.EnableDeveloperModeWithTelemetry());
Benchmark Mode
- EnableBenchmarkMode()
Disables all outputs and enrichments for pure performance testing.builder.Logging.AddCerbiStream(options => options.EnableBenchmarkMode());
Advanced Customization
Queue Configuration:
options.WithQueue("RabbitMQ", "localhost", "logs-queue");
Encryption:
options.WithEncryptionMode(EncryptionType.AES)
.WithEncryptionKey(myKey, myIV);
Governance Validator:
options.WithGovernanceValidator((profile, log) =>
{
return log.ContainsKey("UserId") && log.ContainsKey("IPAddress");
});
Feature Toggles:
options.WithTelemetryLogging(true)
.WithConsoleOutput(true)
.WithMetadataInjection(true)
.WithGovernanceChecks(true);
Usage Examples
Basic Example
var builder = WebApplication.CreateBuilder(args);
builder.Logging.AddCerbiStream(options =>
{
options.EnableDevModeMinimal();
});
var app = builder.Build();
app.Run();
Developer Mode with Custom Queue and Encryption
builder.Logging.AddCerbiStream(options =>
{
options.WithQueue("Kafka", "broker-address", "app-logs")
.WithEncryptionMode(EncryptionType.Base64)
.EnableDeveloperModeWithoutTelemetry();
});
Full Mode with Telemetry and Governance
builder.Logging.AddCerbiStream(options =>
{
options
.WithQueue("AzureServiceBus", "sb://myservicebus.servicebus.windows.net", "logs-queue")
.WithEncryptionMode(EncryptionType.AES)
.WithGovernanceValidator((profile, log) =>
{
return log.ContainsKey("UserId") && log.ContainsKey("IPAddress");
})
.EnableDeveloperModeWithTelemetry();
});
Integration & Supported Platforms
CerbiStream is designed to work in a variety of environments:
Messaging Queues:
Supports RabbitMQ, Kafka, Azure Service Bus, AWS SQS/Kinesis, and Google Pub/Sub.
Telemetry Providers:
Provider | Supported |
---|---|
OpenTelemetry | â |
Azure App Insights | â |
AWS CloudWatch | â |
GCP Trace | â |
Datadog | â |
Pluggable Sinks:
CerbiStream is âsink-agnosticâ â logs are initially routed to queues, and you can integrate downstream tools (e.g., CerbIQ) to manage final delivery to systems such as Splunk, Elasticsearch, or Blob Storage.
Governance and Compliance
A key differentiator of CerbiStream is its built-in governance:
Structured Logging Enforcement:
Ensures that every log entry adheres to predefined schemas for consistency, aiding in compliance with regulatory standards (e.g., HIPAA, GDPR).
External Governance Hook:
If needed, you can provide your own governance validator:
options.WithGovernanceValidator((profile, log) =>
{
return log.ContainsKey("UserId") && log.ContainsKey("IPAddress");
});
Optional CerbiStream.GovernanceAnalyzer:
An add-on package that performs static code analysis to ensure that logging policies are consistently followed.
Telemetry Provider Support
CerbiStream integrates seamlessly with popular telemetry systems to provide extended observability:
Supported providers include: OpenTelemetry, Azure App Insights, AWS CloudWatch, GCP Trace, and Datadog.
Configuration is straightforward through the fluent API, ensuring that enriched log data is automatically forwarded to your chosen telemetry platform.
Unit Testing
Example unit test for CerbiStream logging:
var mockQueue = Substitute.For<IQueue>();
var logger = new CerbiLoggerBuilder()
.WithQueue("TestQueue", "localhost", "unit-test-logs")
.UseNoOpEncryption()
.Build(mockQueue);
var result = await logger.LogEventAsync("Test log event", LogLevel.Information);
Assert.True(result);
Cerbi Suite: The Bigger Picture
CerbiStream is a core component of the Cerbi suiteâa broader ecosystem aimed at providing enterprise-grade observability, governance, and log routing solutions. The suite includes:
- CerbiStream: For high-performance, governance-enforced logging.
- CerbIQ: For advanced log routing, aggregation, and delivery to various sinks.
- CerbiStream.GovernanceAnalyzer: For static and runtime validation ensuring consistent log compliance.
Contributing
Contributions are welcome!
- Report Bugs or Request Features: Open an issue on GitHub.
- Submit Pull Requests: Follow our code style guidelines and ensure tests pass.
- Join the Community: Star the repo, share feedback, and help improve CerbiStream.
License
This project is licensed under the MIT License.
Star the repo â | Contribute đ§ | File issues đ
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)
- 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.0.16 | 0 | 2 hours ago |
1.0.15 | 44 | 3 days ago |
1.0.14 | 41 | 4 days ago |
1.0.13 | 99 | 13 days ago |
1.0.12 | 95 | 14 days ago |
1.0.11 | 428 | 15 days ago |
1.0.10 | 451 | 16 days ago |
1.0.9 | 122 | 18 days ago |
1.0.8 | 39 | 19 days ago |
1.0.7 | 102 | 20 days ago |
1.0.6 | 116 | 21 days ago |
1.0.5 | 118 | 21 days ago |
1.0.4 | 110 | 22 days ago |
1.0.3 | 110 | 22 days ago |
1.0.2 | 129 | a month ago |
1.0.1 | 119 | a month ago |