CerbiStream 1.0.16

dotnet add package CerbiStream --version 1.0.16
                    
NuGet\Install-Package CerbiStream -Version 1.0.16
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CerbiStream" Version="1.0.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CerbiStream" Version="1.0.16" />
                    
Directory.Packages.props
<PackageReference Include="CerbiStream" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CerbiStream --version 1.0.16
                    
#r "nuget: CerbiStream, 1.0.16"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=CerbiStream&version=1.0.16
                    
Install CerbiStream as a Cake Addin
#tool nuget:?package=CerbiStream&version=1.0.16
                    
Install CerbiStream as a Cake Tool

CerbiStream: Dev-Friendly, Governance-Enforced Logging for .NET

NuGet Downloads License .NET

Dev Friendly Governance Enforced

Cerbi CI Quality Gate

🚀 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

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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