TL.AuditLogger 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TL.AuditLogger --version 0.1.0
                    
NuGet\Install-Package TL.AuditLogger -Version 0.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="TL.AuditLogger" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TL.AuditLogger" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="TL.AuditLogger" />
                    
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 TL.AuditLogger --version 0.1.0
                    
#r "nuget: TL.AuditLogger, 0.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 TL.AuditLogger@0.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=TL.AuditLogger&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=TL.AuditLogger&version=0.1.0
                    
Install as a Cake Tool

🛡️ TL.AuditLogger

NuGet .NET License: MIT

Structured audit logging utility for .NET: automatic JSON property diff calculation, pluggable storage backends, and zero-leak event dispatching.
Biblioteca de auditoria estruturada para .NET: cálculo automático de diff diferencial JSON por propriedade, provedores plugáveis de armazenamento e despacho sem vazamento de memória.

O TL.AuditLogger fornece uma infraestrutura robusta e desacoplada para rastrear operações de alteração de estado (CRUD) em aplicações .NET. Ele captura o estado anterior e posterior das entidades, computa automaticamente o diferencial estruturado em JSON e despacha os registros para destinos de armazenamento configuráveis.


📦 Instalação

Adicione o pacote ao seu projeto através do .NET CLI:

dotnet add package TL.AuditLogger

🚀 Funcionalidades Principais

Categoria Componentes & Métodos Descrição
Operações de Auditoria LogCreate(), LogUpdate(), LogDelete() Métodos da interface IAuditLogger para registro de mutações com identificação de usuário e entidade.
Cálculo de Diff Diferencial AuditLogEntry, Changes Geração automática de histórico diferencial em JSON destacando propriedades adicionadas, modificadas e removidas.
Armazenamento Pluggável IAuditLogStorage, MemoryCache, Serilog, NLog Estratégia extensível com provedores prontos para logs estruturados em arquivo, console ou cache temporário.
Injeção de Dependência AddAuditLogger(IConfiguration) Configuração fluente no container nativo do .NET com validação de opções no startup.

💡 Exemplos de Uso

1. Registro em Injeção de Dependência

using AuditLogger.DependencyInjection;

// No Program.cs
builder.Services.AddAuditLogger(builder.Configuration);

2. Configuração no appsettings.json

{
  "AuditLoggerSettings": {
    "StorageType": "MemoryCache",
    "CacheDuration": "00:15:00"
  }
}

3. Registro Estruturado com Cálculo Automático de Diff

using AuditLogger.Interfaces;

public class PedidoService
{
    private readonly IAuditLogger _auditLogger;

    public PedidoService(IAuditLogger auditLogger)
    {
        _auditLogger = auditLogger;
    }

    public void AtualizarStatus(Pedido pedidoOriginal, Pedido pedidoModificado, string usuarioId)
    {
        pedidoModificado.Status = "Aprovado";
        pedidoModificado.ValorTotal = 1500.00m;

        string logId = _auditLogger.LogUpdate(pedidoOriginal, pedidoModificado, usuarioId);
    }
}

🏛️ Decisões Arquiteturais e Segurança

Para detalhes sobre governança, ciclo de vida de instâncias e estratégias de isolamento de log:


📄 Licença

Distribuído sob a licença MIT.

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 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
0.5.0 108 9/27/2026
0.4.0 108 9/23/2026
0.3.0 116 9/18/2026
0.2.0 124 9/12/2026
0.1.0 123 9/7/2026