Ledon.AuditLog 0.0.1

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

Ledon.AuditLog

操作审计流水:谁在何时对哪个实体做了什么、改了哪些属性(before/after)。合规与排障刚需。

builder.Services.AddLedonAudit<AppDbContext>();   // 持久化(AppDbContext 需含 DbSet<AuditEntry>)
app.UseLedonAuditContext();                      // 自动填操作人 / IP / 请求 ID

只依赖 EF 的 SaveChanges 拦截器,业务代码零改动:

  • 新增/修改/删除自动记录;修改只记真实变化的属性;
  • 审计写在业务事务提交之后:业务回滚不会留下"改过了"的假记录;
  • 审计自身失败只记日志,不回滚业务(审计不能拖垮业务);
  • 操作人来自登录声明(sub/NameIdentifier),后台任务用 AuditContext.BeginScope(userId, name) 声明;
  • 查询:IAuditStore.QueryAsync(entityType, entityId);保留策略:PurgeOlderThanAsync(默认 90 天);
  • 内存实现(AddLedonAudit())供开发/单实例;AddLedonAudit<TContext>() 持久化。

完整文档:https://github.com/wosledon/ledon-framework

Product Compatible and additional computed target framework versions.
.NET 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
0.0.1 46 10/28/2026