serilog 指定属性名称以在解构期间忽略它们

问题描述 投票:0回答:1

destructurama.byignoring 可以被 lambda 忽略。

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

此外,还有 masking.serilog 可以按属性名称进行屏蔽

Log.Logger = new LoggerConfiguration()
    .Destructure.ByMaskingProperties("Password", "Token")
    .CreateLogger()

是否有一个包可以通过属性名称忽略属性。

asp.net logging serilog
1个回答
0
投票

添加对 LogPropertyIgnoreAttribute 的支持:https://github.com/destructurama/attributed/pull/113

© www.soinside.com 2019 - 2024. All rights reserved.