QERP.Log
1.1.0
dotnet add package QERP.Log --version 1.1.0
NuGet\Install-Package QERP.Log -Version 1.1.0
<PackageReference Include="QERP.Log" Version="1.1.0" />
<PackageVersion Include="QERP.Log" Version="1.1.0" />
<PackageReference Include="QERP.Log" />
paket add QERP.Log --version 1.1.0
#r "nuget: QERP.Log, 1.1.0"
#:package QERP.Log@1.1.0
#addin nuget:?package=QERP.Log&version=1.1.0
#tool nuget:?package=QERP.Log&version=1.1.0
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
TraceIdandSpanIdto 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
Exceptionobject as the first parameter toLogErrorto 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 | Versions 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. |
-
net10.0
- Grpc.AspNetCore.Server (>= 2.67.0)
- Serilog (>= 4.2.0)
- Serilog.AspNetCore (>= 9.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.Grafana.Loki (>= 8.3.2)
-
net8.0
- Grpc.AspNetCore.Server (>= 2.67.0)
- Serilog (>= 4.2.0)
- Serilog.AspNetCore (>= 8.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.Grafana.Loki (>= 8.3.0)
-
net9.0
- Grpc.AspNetCore.Server (>= 2.67.0)
- Serilog (>= 4.2.0)
- Serilog.AspNetCore (>= 9.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.Grafana.Loki (>= 8.3.0)
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 |