Rwd.AuditLog.Sdk 2.0.0

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

Audit.Sdk

Producer SDK for the Central Audit Log Service. Producers call one method per entity affected by a business operation; the SDK auto-fills all system fields and publishes the event via the Wolverine durable outbox (so it commits atomically with the producer's domain transaction).

Usage

// Program.cs — one line (throws at startup if ClientId/ClientName are missing).
builder.Services.AddAuditSdk(o =>
{
    o.ClientId    = "admin_portal";     // the producer's IAM client id
    o.ClientName  = "Admin Portal";    // human-readable service name
    o.ProducerName = "admin_portal";   // routing-key slug -> audit.admin_portal
});
// In a transactional handler.
public async Task Handle(ArchiveAssetCommand cmd, AppDbContext db, IAuditPublisher audit)
{
    var referenceId = Guid.NewGuid();
    var before = JsonSerializer.Serialize(asset);
    asset.Archive();
    var after = JsonSerializer.Serialize(asset);

    await audit.PublishAsync(referenceId, "RealtyAsset.Archived",
        new AuditEntity(asset.Id.ToString(), asset.NameAr, asset.NameEn), before, after);

    await db.SaveChangesAsync(); // Wolverine relays the audit event after commit
}

Producers also wire their existing Wolverine IMessageBus and an IAuditTransactionAccessor (e.g. checking DbContext.Database.CurrentTransaction). Depends on Audit.Messaging.

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
2.0.0 449 6/15/2026
1.0.0 248 6/10/2026