0

在生产系统中隐藏 PII(个人身份信息)是一个好主意,有时甚至是法律义务,但在开发环境中调试时,这是荒谬的废话,使错误消息毫无价值。如何将其配置为在调试器中禁用但在生产中启用?

4

1 回答 1

0

在代码中(Kestrel 上的 netcore)

Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = env.IsDevelopment();

在特定计算机上

<configuration>
  <system.serviceModel>
    <machineSettings enableLoggingKnownPii="true" />
  </system.serviceModel>
</configuration>
于 2020-08-12T01:13:10.987 回答