SmartLogger 3.0.0

dotnet add package SmartLogger --version 3.0.0
                    
NuGet\Install-Package SmartLogger -Version 3.0.0
                    
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="SmartLogger" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SmartLogger" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SmartLogger" />
                    
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 SmartLogger --version 3.0.0
                    
#r "nuget: SmartLogger, 3.0.0"
                    
#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.
#:package SmartLogger@3.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SmartLogger&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=SmartLogger&version=3.0.0
                    
Install as a Cake Tool

SmartLogger: Lightweight Logging for High-Performance Systems

Build observability without sacrificing performance or simplicity.

SmartLogger is a lightweight, extensible logging framework for .NET applications, designed to provide structured, reliable, and configurable logging without unnecessary complexity.


Design Philosophy

Logging must never compromise application stability.

SmartLogger is built with a strong focus on:

  • Predictable behavior under load
  • Minimal runtime overhead
  • Clear and flexible configuration
  • Extensibility without complexity

Architecture Overview

SmartLogger follows a clean, layered pipeline:

Log Call
   ↓
Logger
   ↓
Layout (Pattern + Tokens)
   ↓
Formatter (PlainText / JSON / XML)
   ↓
Appender (Console / File / etc.)

This design ensures:

  • Separation of concerns
  • Easy extensibility
  • Maintainable logging pipeline

Key Features

  • Log levels with priority filtering
  • Customizable log layouts (pattern + tokens)
  • Multiple output formats (PlainText, JSON, XML)
  • Multiple appenders (Console, FileSystem, extensible)
  • Async logging support for high throughput
  • Runtime configuration reload (hot reload)
  • Correlation ID support (AsyncLocal-based)
  • Thread-safe logging pipeline
  • File rolling strategies (size/time-based)

💡 Why SmartLogger?

SmartLogger helps you:

  • Maintain consistent logging standards
  • Trace requests across execution flows using correlation IDs
  • Handle high log volumes safely
  • Dynamically update logging without restarting apps
  • Build observable systems with minimal setup

Quick Start

1️⃣ Install via NuGet

Install-Package SmartLogger

2️⃣ Initialize Logger

JSON Configuration
var provider = new JsonConfigurationProvider(
    "smartlogger.json",
    enableAutoReload: true);

LoggerManager.Initialize(provider);

In-Memory Configuration
var config = new LogConfigurationHolder
{
    RootLogLevel = LogLevel.INFO,
    Appenders = new List<AppenderConfiguration>
    {
        new AppenderConfiguration
        {
            Destination = new DestinationConfiguration
            {
                Type = LogOutputDestination.Console
            },
            AppenderLogLevel = LogLevel.DEBUG
        }
    }
};

LoggerManager.Initialize(new InMemoryConfigurationProvider(config));

3️⃣ Get Logger

var logger = LoggerManager.GetLogger("OrderService");

4️⃣ Log Messages

logger.Info("Order created successfully.");
logger.Warning("Inventory running low.");
logger.Error("Payment gateway timeout.");

Correlation Logging Example

using (LogContext.BeginCorrelationScope("REQ-123"))
{
    logger.Info("Processing request...");
    logger.Error("Request failed");
}

Example JSON Configuration

{
  "rootLogLevel": "DEBUG",
  "appenders": [
    {
      "destination": {
        "type": "Console"
      },
      "appenderLogLevel": "DEBUG",
      "formatter": {
        "outputFormat": "PlainText",
        "layoutType": "Detailed"
      }
    }
  ]
}

For more information on configuration refer: SmartLogger_Configuration_Guide


Ideal Use Cases

  • Learning system design
  • Web APIs
  • Background workers
  • Microservices
  • High-throughput systems

Summary

SmartLogger provides a clean and extensible logging solution for .NET applications, with support for:

  • Structured logging
  • Correlation tracking
  • Runtime configuration
  • High-performance scenarios

Designed to help you build observable, maintainable, and resilient systems.

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.
  • net8.0

    • No dependencies.

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
3.0.0 100 5/2/2026
2.0.0 94 5/1/2026
1.2.3 94 4/29/2026
1.0.6 131 2/21/2026
1.0.5 139 2/21/2026 1.0.5 is deprecated.
1.0.3 138 2/15/2026 1.0.3 is deprecated.
1.0.0 131 2/15/2026 1.0.0 is deprecated.