Type of issue
Other (describe below)
Description
This code example in section "Redacting sensitive information in logs" is incomplete because to get the code running, I have to hunt for the declaration of these types across multiple documents:
There is also an error in C# syntax:
[MyTaxonomyClassifications.Private]
|
```csharp |
|
[LoggerMessage(0, LogLevel.Information, "User SSN: {SSN}")] |
|
public static partial void LogPrivateInformation( |
|
this ILogger logger, |
|
[MyTaxonomyClassifications.Private] string SSN); |
|
``` |
MyTaxonomyClassifications.Private is a static property inside the class MyTaxonomyClassifications thus can't be used in attribute syntax.
Correct code should be:
[LoggerMessage(0, LogLevel.Information, "User SSN: {SSN}")]
public static partial void LogPrivateInformation(
this ILogger logger,
[PrivateInformationAttribute] string SSN);
But PrivateInformationAttribute is current missing in this doc.
Page URL
https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/source-generation
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/extensions/logging/source-generation.md
Document Version Independent Id
443c0b98-55c6-5519-7da5-380f45076c7b
Platform Id
f655ece6-62d1-5404-329a-3c3cafa94103
Article author
gewarren
Metadata
- ID: 697f6282-9c7f-2435-87e5-0a889a6dfcb9
- PlatformId: f655ece6-62d1-5404-329a-3c3cafa94103
- Service: dotnet-fundamentals
Associated WorkItem - 596911
Related Issues
Type of issue
Other (describe below)
Description
This code example in section "Redacting sensitive information in logs" is incomplete because to get the code running, I have to hunt for the declaration of these types across multiple documents:
PrivateInformationAttributeStarRedactorStarRedactorProviderThere is also an error in C# syntax:
[MyTaxonomyClassifications.Private]docs/docs/core/extensions/logging/source-generation.md
Lines 366 to 371 in d26cd50
MyTaxonomyClassifications.Privateis a static property inside the classMyTaxonomyClassificationsthus can't be used in attribute syntax.Correct code should be:
But
PrivateInformationAttributeis current missing in this doc.Page URL
https://learn.microsoft.com/en-us/dotnet/core/extensions/logging/source-generation
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/extensions/logging/source-generation.md
Document Version Independent Id
443c0b98-55c6-5519-7da5-380f45076c7b
Platform Id
f655ece6-62d1-5404-329a-3c3cafa94103
Article author
gewarren
Metadata
Associated WorkItem - 596911
Related Issues