QERP.Logger 1.0.2

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

Qerp.LoggingPkg

Standardized logging library for QERP microservices based on Serilog and OpenTelemetry. It provides a unified way to configure structured logging, HTTP request monitoring, and distributed tracing across the ecosystem.

Features

  • Structured Logging: Automatic indexing of log properties for efficient searching in Grafana Loki.
  • Observability: Built-in support for W3C Trace Context, automatically attaching TraceId and SpanId to all log events.
  • Pluggable Sinks: Configure multiple destinations with a single bitwise flag:
    • Console: Formatted human-readable output.
    • File: Structured JSON logs with rolling retention.
    • Loki: Direct push to Grafana Loki.
  • HTTP Request Monitoring: Automatic logging of request path, method, client IP, and performance metrics.
  • Noise Reduction: pre-configured filters to silence verbose framework logs.

Installation

Add the package via the project properties or CLI:

dotnet add package QERP.Logger

Quick Start

1. Register Logging in Host

In your Program.cs, use the extension methods to register the logging services:

using Qerp.LoggingPkg;

var builder = WebApplication.CreateBuilder(args);

// Register QERP Logging
builder.AddQerpLogging(options => 
{
    options.ApplicationName = "MyMicroservice";
    options.Environment = "Development";
    options.SinkType = LogSinkType.Console | LogSinkType.Loki;
    options.LokiUrl = "http://loki:3100";
});

var app = builder.Build();

// Enable HTTP Request Logging
app.UseQerpRequestLogging();

app.Run();

2. Using the Logger

Inject ILogger<T> into your services:

public class MyService(ILogger<MyService> logger)
{
    public void DoWork()
    {
        // Use structured logging (message templates)
        logger.LogInformation("Processing item {ItemId}", 123);
    }
}

Best Practices

  • Avoid String Interpolation: Always use message templates (e.g., logger.LogInformation("User {UserId} logged in", userId)) to preserve structured data for Loki.
  • Log Exceptions correctly: Pass the Exception object as the first parameter to LogError to ensure stack traces are captured.
  • Trace Context: The package automatically handles distributed tracing. No manual TraceId attachment is required.

Documentation

For more detailed information, see:

License & Proprietary Notice

PROPRIETARY SOFTWARE: This library is a proprietary asset of QFL. Unauthorized redistribution, modification, or use outside of QFL-authorized projects is strictly prohibited.

For detailed licensing terms, see LICENSE.

Metadata

  • Authors: Jewel Hossain
  • License: QFL Proprietary
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 is compatible.  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 is compatible.  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.0.2 132 2/28/2026
1.0.1 104 2/28/2026
1.0.0 105 2/28/2026