2

Hiding PII (personally identifiable information) in a production system is a good idea and sometimes a legal obligation, but in a development environment while debugging it is ridiculous nonsense that makes error messages worthless. How can I configure this to be disabled in my debugger but enabled in production?

Peter Wone
  • 17,965
  • 12
  • 82
  • 134

1 Answers1

2

In code (netcore on Kestrel)

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

On a particular computer

<configuration>
  <system.serviceModel>
    <machineSettings enableLoggingKnownPii="true" />
  </system.serviceModel>
</configuration>
Peter Wone
  • 17,965
  • 12
  • 82
  • 134
  • It is worth mentioning that it is against GDPR rules to use this in Production. So be careful: DO NOT TURN THIS ON IN PRODUCTION!!! – Serhat Apr 19 '23 at 15:27