Quantum.Logging 1.0.0

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

Quantum.Logging

NuGet Version License: MIT

Quantum.Logging es una librería de configuración para el ecosistema Quantum que simplifica drásticamente la integración de un logging estructurado y potente en aplicaciones .NET, utilizando Serilog como motor.

✨ Características Principales

  • Configuración en una Línea: Habilita un sistema de logging completo y profesional con una sola llamada en Program.cs.
  • Basado en Serilog: Aprovecha el poder y la flexibilidad de la librería de logging más popular de .NET.
  • Configuración Centralizada: Lee toda la configuración de niveles y destinos (sinks) directamente desde tu archivo appsettings.json.
  • Integración Estándar: Se integra a la perfección con la abstracción ILogger<T> de Microsoft, por lo que tu código de aplicación no depende directamente de Serilog.

🚀 Uso

1. Configurar appsettings.json

Añade una sección "Serilog" a tu archivo de configuración para definir los niveles y destinos.

{
  "Serilog": {
    "MinimumLevel": {
      "Default": "Information",
      "Override": { "Microsoft": "Warning", "System": "Warning" }
    },
    "WriteTo": [
      { "Name": "Console" },
      {
        "Name": "File",
        "Args": { "path": "logs/applog-.txt", "rollingInterval": "Day" }
      }
    ]
  }
}

2. Activar en Program.cs

Llama al método de extensión al configurar tus servicios.

using Quantum.Logging.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Activa el logging de Quantum
builder.Services.AddQuantumLogging(builder.Configuration);

// ...

3. Inyectar y Usar

Inyecta la interfaz estándar ILogger<T> en cualquier servicio o controlador.

public class MiServicio
{
    private readonly ILogger<MiServicio> _logger;
    public MiServicio(ILogger<MiServicio> logger) => _logger = logger;

    public void Procesar()
    {
        _logger.LogInformation("Procesando la solicitud {RequestId}", Guid.NewGuid());
        // ...
    }
}

📄 Licencia

Este proyecto está licenciado bajo la Licencia MIT.

Product Compatible and additional computed target framework versions.
.NET 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 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.0.0 180 9/12/2025

Versión 1.0.0: Lanzamiento inicial.
 - Introduce el método de extensión AddQuantumLogging para una configuración simple.
 - Se integra con Serilog y lee la configuración desde appsettings.json.