QERP.Log 1.1.0

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

QERP.Log

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.Log.Extensions;
using QERP.Log.Enums;

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 (1)

Showing the top 1 NuGet packages that depend on QERP.Log:

Package Downloads
QERP.Response

Standardized API response package with global exception handler middleware, built-in exception types, TraceId/SpanId correlation, application-style response codes, EF Core message lookup, and Redis caching.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 786 3/24/2026