Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在生产系统中隐藏 PII(个人身份信息)是一个好主意,有时甚至是法律义务,但在开发环境中调试时,这是荒谬的废话,使错误消息毫无价值。如何将其配置为在调试器中禁用但在生产中启用?
Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = env.IsDevelopment();
<configuration> <system.serviceModel> <machineSettings enableLoggingKnownPii="true" /> </system.serviceModel> </configuration>