Skip to main content
.NETStandard1.0.NETStandard2.0.NETStandard2.1

Specify how complex types are logged to Serilog by excluding individual properties.

Published
Jan 17, 2024
2y ago
Total Downloads
1.5M
1,512,208

Install

dotnet add package Destructurama.ByIgnoring --version 2.0.1-dev-00085
ProductVersions
.NET Standard
netstandard1.0netstandard2.0netstandard2.1

README

Destructurama.ByIgnoring Build status

Specify how complex types are logged to Serilog by excluding individual properties.

Install from NuGet:

Install-Package Destructurama.ByIgnoring

Mark properties to ignore on target types:

Log.Logger = new LoggerConfiguration()
    .Destructure.ByIgnoringProperties<User>(u => u.Password)
    // Other logger configuration
    .CreateLogger()

When these types are destructured, all instance (that is not static) properties except the specified ones will be passed through:

Log.Information("Logged on {@User}", new User { Username = "nick", Password = "This is ignored" });

// Prints `Logged on User { Username: "nick"  }`

Changes from Previous Version

v2.0.0v2.0.1-dev-00085
Added Dependencies
NETStandard.Library(.NETStandard1.0)

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.