Skip to content

Better example in the section: Enable sensitive data logging #35883

@ThomasSkyldahl

Description

@ThomasSkyldahl

Description

Wouldn't a better option be to use Environment.IsProduction() to avoid enabling sensitive logging in the production environment.
The current example shows the use of #if DEBUG to decide how the sensitive logging is handled.
this could lead to leaking sensitive information if somebody deploys a DEBUG assembly to production for any given reason.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/blazor-ef-core?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/blazor-ef-core.md

Document ID

2ebc5e4d-bab4-6d30-9018-9a712c482236

Platform Id

5fb075cd-0c65-79c2-a4ad-4a4658816c3b

Article author

@guardrex

Metadata

  • ID: 2ebc5e4d-bab4-6d30-9018-9a712c482236
  • PlatformId: 5fb075cd-0c65-79c2-a4ad-4a4658816c3b
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions