Dloizides.CommandLogging
1.0.0
dotnet add package Dloizides.CommandLogging --version 1.0.0
NuGet\Install-Package Dloizides.CommandLogging -Version 1.0.0
<PackageReference Include="Dloizides.CommandLogging" Version="1.0.0" />
<PackageVersion Include="Dloizides.CommandLogging" Version="1.0.0" />
<PackageReference Include="Dloizides.CommandLogging" />
paket add Dloizides.CommandLogging --version 1.0.0
#r "nuget: Dloizides.CommandLogging, 1.0.0"
#:package Dloizides.CommandLogging@1.0.0
#addin nuget:?package=Dloizides.CommandLogging&version=1.0.0
#tool nuget:?package=Dloizides.CommandLogging&version=1.0.0
Dloizides.CommandLogging
Shared FastEndpoints command-pipeline logger with
secret redaction. Logs each command's name and property values and times its
execution — but redacts values of sensitive-looking properties
(password/secret/token/apikey/pin/…) so they never reach stdout.
Extracted from three services (Questioner, OnlineMenu, Kefi) that had each hand-copied the middleware. Two of the copies still logged secrets in plaintext; this package canonicalises on the redacting version so the fix lives in one place.
Install
<PackageReference Include="Dloizides.CommandLogging" />
Use
Register it in the FastEndpoints command-middleware pipeline:
using Dloizides.CommandLogging;
builder.Services
.AddFastEndpoints()
.AddCommandMiddleware(c => c.AddCommandLogging());
That registers the open-generic CommandLogger<TCommand, TResult> for every command.
Extending the redaction list
The redaction list is the central choke point. Add fragments at startup:
using Dloizides.CommandLogging;
// e.g. before building the app
SensitivePropertyNames.AddFragment("ssn");
SensitivePropertyNames.AddFragment("iban");
Matching is case-insensitive substring, so AddFragment("ssn") also redacts
SocialSecurityNumber if that contains ssn — pick fragments accordingly.
API
| Member | Purpose |
|---|---|
CommandLogger<TCommand, TResult> |
The ICommandMiddleware implementation. |
CommandMiddlewareConfig.AddCommandLogging() |
Registers the middleware. |
SensitivePropertyNames.IsSensitive(name) |
The redaction predicate. |
SensitivePropertyNames.AddFragment(fragment) |
Extends the redaction list at startup. |
SensitivePropertyNames.DefaultFragments |
The built-in fragment list. |
SensitivePropertyNames.RedactedPlaceholder |
The *** substitute token. |
License
MIT
| 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 was computed. 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. |
-
net8.0
- FastEndpoints (>= 7.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
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 | 257 | 7/17/2026 |