CerbiStream 1.1.18

dotnet add package CerbiStream --version 1.1.18
                    
NuGet\Install-Package CerbiStream -Version 1.1.18
                    
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.1.18" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CerbiStream" Version="1.1.18" />
                    
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.1.18
                    
#r "nuget: CerbiStream, 1.1.18"
                    
#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.1.18
                    
Install as a Cake Addin
#tool nuget:?package=CerbiStream&version=1.1.18
                    
Install as a Cake Tool

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.

CerbiStream NuGet CerbiStream Downloads Governance Analyzer NuGet Governance Analyzer Downloads Build Status Quality Gate Status

Benchmark Tests Repo License: MIT


πŸ”— Supported Destinations

CerbiStream can route logs to:

  • Queues: Azure Service Bus, RabbitMQ, Kafka, AWS SQS/Kinesis, Google Pub/Sub
  • HTTP Endpoints: Any REST API with custom headers
  • Cloud Storage: Azure Blob, AWS S3, Google Cloud Storage
  • File Fallback: Local JSON file (AES/Base64 encryption supported)
  • Telemetry Providers: App Insights, OpenTelemetry, Datadog, AWS CloudWatch, GCP Stackdriver

🧱 CerbiSuite Overview

Component Purpose
CerbiStream Structured logging for .NET with queue & cloud targets
Cerbi.Governance.Runtime Runtime enforcement of governance rules
CerbiStream.GovernanceAnalyzer Compile-time governance analyzer
CerbiShield (coming soon) Governance dashboard & deployment portal
CerbIQ (coming soon) Metadata aggregation + routing pipeline
CerbiSense (coming soon) Governance scoring & ML analysis engine

πŸ“š Table of Contents


πŸ†• 2025 Governance Update

CerbiStream now uses real-time governance enforcement via Cerbi.Governance.Runtime, removing most limitations of build-time validation.

βœ… Runtime Advantages:

  • Compatible with .NET 6–8+
  • Config from local, blob, or GitHub
  • Automatically tags logs with governance info
  • Supports .Relax() and [CerbiTopic]

⚠️ Build-Time Analyzer Limitations:

  • Requires local files and static references
  • Not compatible with CI or dynamic config

πŸ”„ Recent Updates (v1.1.2)

  • Unified enrichment with LogId, ApplicationId, etc.
  • Full-payload encryption using AES or Base64
  • File fallback + cloud destinations (HTTP/Blob)
  • Built-in governance validation
  • Topic tagging and relaxed logging support

Developer Quick Start

πŸ‘‰ Quick Start Guide

🧰 Developer Setup Matrix

Scenario Method(s) Used Description
πŸ”Ή Basic Dev (No Governance) EnableDevModeMinimal() Minimal config, console only
πŸ”Έ Dev + Governance EnableDeveloperModeWithoutTelemetry() + .WithGovernanceChecks(true) Runtime enforcement, no telemetry
🟒 Dev + Governance + Telemetry EnableDeveloperModeWithTelemetry() + .WithGovernanceChecks(true) + .WithTelemetryProvider(...) Full stack logging with runtime governance and telemetry
πŸ§ͺ Benchmarking EnableBenchmarkMode() Disables all enrichments for performance tests
πŸ› οΈ Production EnableProductionMode() + .WithQueue(...) + .WithEncryptionMode(...) Production-ready config with security and routing

πŸ”Ή Basic Development (No Governance)

builder.Logging.AddCerbiStream(options =>
{
    options.EnableDevModeMinimal();
});

πŸ”Έ Development with Real-Time Governance

builder.Logging.AddCerbiStream(options =>
{
    options.WithFileFallback("cerbi_fallback.json")
           .WithGovernanceChecks(true)
           .WithGovernanceProfile("default")
           .EnableDeveloperModeWithoutTelemetry();
});

🟒 Development with Governance + Telemetry

builder.Logging.AddCerbiStream(options =>
{
    options.WithQueue("AzureServiceBus", "Endpoint=sb://...", "log-queue")
           .WithEncryptionMode(EncryptionType.Base64)
           .WithGovernanceChecks(true)
           .WithTelemetryProvider(
               TelemetryProviderFactory.CreateTelemetryProvider("appinsights")
           )
           .EnableDeveloperModeWithTelemetry();
});

---

## Advanced Setup & Best Practices

πŸ‘‰ [Advanced Setup Guide](LoggingStandards/README-CerbiStream–AdvancedSetup&BestPractices.md)

---

## Overview

CerbiStream is a developer-first logging library built for performance, security, and governance enforcement.

---

## Highlights

- Async, queue-first architecture
- Flexible encryption
- Runtime governance validation
- Low object allocation
- Azure/GCP/AWS-aware metadata

---

## βš™οΈ Configuration Options

- `.WithQueue(...)`
- `.WithEncryptionMode(...)`
- `.WithFileFallback(...)`
- `.WithGovernanceChecks(...)`
- `.EnableDeveloperModeWithTelemetry()`

### Encryption Types
- `None`
- `Base64`
- `AES`

### Config Sources
- Local JSON
- Azure Blob / AWS S3 / GCP
- GitHub raw URL

---

## Features

- Topic-based log scoping
- Metadata injection
- Governance policy validation
- Relaxed log support
- Queue & blob transport
- Polly retry support

---

## Governance and Compliance

- Runtime enforcement with `Cerbi.Governance.Runtime`
- Analyzer available for CI validation
- Tags include `GovernanceProfileUsed`, `GovernanceViolations`, etc.

---

## Advanced Metadata & Encryption

```csharp
options.WithMetadataInjection(true)
       .WithEncryptionMode(EncryptionType.AES)
       .WithEncryptionKey(key, iv);

JSON logs are fully encrypted before sending.


Usage Examples

  • Relaxed logging: logger.Relax()
  • Topic assignment: [CerbiTopic("Payments")]
  • Fallback to file: .WithFileFallback("fallback.json")
  • Multi-cloud: auto-populates cloud provider

πŸ”“ Relaxed Logging Modes

Cerbi supports two forms of relaxed logging to bypass governance rules when explicitly intended:

Mode Description Usage Example Fluent .Relax() Developer-triggered, scoped for individual log statements logger.Relax().LogInformation("...") Runtime .RelaxGovernance() Global override, wraps logger during startup configuration logger = logger.RelaxGovernance();

πŸ§‘β€πŸ’» Developer Inline (Fluent API):

var logger = builder.Logging.CreateLogger("MyApp");
logger = logger.RelaxGovernance(); // All logs now include GovernanceRelaxed: true

This uses CerbiLoggerWrapper for structured logging, useful during development or for logs intentionally excluded from governance enforcement.

βš™οΈ Runtime Setup Override:

var logger = builder.Logging.CreateLogger("MyApp");
logger = logger.RelaxGovernance(); // All logs now include GovernanceRelaxed: true

Integration & Supported Platforms

  • Queues: RabbitMQ, Azure, Kafka, etc.
  • HTTP REST APIs
  • Azure Blob, AWS S3, GCP Storage
  • Auto-detect metadata from cloud env vars

Telemetry Provider Support

Provider Activation Code
App Insights CreateTelemetryProvider("appinsights")
OpenTelemetry ...("opentelemetry")
AWS CloudWatch ...("awscloudwatch")
Datadog ...("datadog")
GCP Stackdriver ...("gcpstackdriver")

Benchmark vs Serilog

Metric CerbiStream Serilog
Log Throughput >50K logs/sec 10–30K logs/sec
Encryption Native, full JSON External libs required
Memory per log ~1–3 KB ~10–30 KB
Governance Built-in Requires plugin stack

Unit Testing

Covers:

  • Governance rule enforcement
  • Retry/backoff
  • Metadata injection
  • Fallback logging rotation
  • Encryption and validation

Contributing

PRs welcome! Please open an issue first for large features. Follow code style and ensure tests pass.


Community & Support


πŸ“Œ Under the Hood: Runtime Defaults & Utilities

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  log   β”‚
   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ enrich   │◄───┐
  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜    β”‚
       β–Ό          β”‚
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
  β”‚ encrypt  β”‚     β”‚
  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜     β”‚
       β–Ό          β”‚
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
  β”‚ validate β”‚     β”‚
  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜     β”‚
       β–Ό          β”‚
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
  β”‚  send    β”‚β”€β”€β”€β”€β”€β”˜
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β–²
       β”‚
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ RetryPolicy  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

CerbiStream includes helpful built-in utilities and conventions:

☁️ Cloud Metadata Detection

Pulled from environment variables using ApplicationMetadata:

  • CloudProvider resolves from AWS, Azure, or GCP.
  • Region is inferred from cloud-specific variables.
  • InstanceId and ApplicationVersion are auto-filled.

πŸ› οΈ Central Config Convenience

Use CerbiStreamConfig for:

  • Single-file config initialization
  • Auto-detected cloud + env context
  • Runtime feature toggles (e.g., encryption, telemetry)

πŸ” Retry Behavior

Retry logic for queue delivery is powered by Polly:

RetryPolicyFactory.Create(3, 200); // Retries 3x with 200ms delay

This is used when .WithQueueRetries(...) is enabled.

πŸ“‘ Telemetry Integration

Quickly wire up telemetry providers with:

TelemetryProviderFactory.CreateTelemetryProvider("appinsights");

Supported options include AppInsights, OpenTelemetry, Datadog, AWS CloudWatch, and GCP Stackdriver.


License

MIT Β© Cerbi LLC

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.  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. 
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.1.18 137 5/20/2025
1.1.17 136 5/20/2025
1.1.16 138 5/20/2025
1.1.15 97 5/18/2025
1.1.14 219 5/15/2025
1.1.13 216 5/14/2025
1.1.12 225 5/14/2025
1.1.11 218 5/14/2025
1.1.10 220 5/14/2025
1.1.9 224 5/13/2025
1.1.8 234 5/13/2025
1.1.7 136 5/6/2025
1.1.6 158 4/27/2025
1.1.5 150 4/27/2025
1.1.3 126 4/27/2025
1.1.2 142 4/25/2025
1.1.1 181 4/13/2025
1.1.0 177 4/13/2025
1.0.16 140 4/10/2025
1.0.15 140 4/7/2025
1.0.14 93 4/6/2025
1.0.13 116 3/28/2025
1.0.12 108 3/27/2025
1.0.11 445 3/26/2025
1.0.10 466 3/25/2025
1.0.9 135 3/23/2025
1.0.8 51 3/22/2025
1.0.7 114 3/21/2025
1.0.6 125 3/20/2025
1.0.5 129 3/20/2025
1.0.4 121 3/19/2025
1.0.3 123 3/19/2025
1.0.2 141 3/12/2025
1.0.1 131 3/12/2025