有 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()
是否有一个包可以通过属性名称忽略属性。
添加对 LogPropertyIgnoreAttribute 的支持:https://github.com/destructurama/attributed/pull/113