You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added this
` loggingBuilder.EnableRedaction();
//// Add the redaction services
//// For [SensitiveData], use the MaskingErasingRedactor.
//// For [PersonalData] use the HmacRedactor.
loggingBuilder.Services.AddRedaction(x =>
{
//// 👇 Enable the erasing redactor for sensitive data
x.SetRedactor(new DataClassificationSet(Taxonomy.SensitiveData));
//// 👇 Enable the HMAC256 redactor for personal data
x.SetHmacRedactor(hmacOpts =>
{
hmacOpts.Key = Convert.ToBase64String(Encoding.UTF8.GetBytes("Some super secret key that's really long for security"));
hmacOpts.KeyId = 123;
}, new DataClassificationSet(Taxonomy.PersonalData));
});`
I made my own attributes after the guides.
I created a record User
` public sealed record User
{
[SensitiveData]
public string? Name { get; set; }
public string? Email { get; set; }
} `
When I log when using Opentelemetry and a consolexporter, or the jsonconsole the log exist in my console. But not as a log in or example Aspire logs.
Is it intended that logs shall not be exported but only work with the console outputs?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I added this
` loggingBuilder.EnableRedaction();
//// Add the redaction services
//// For [SensitiveData], use the MaskingErasingRedactor.
//// For [PersonalData] use the HmacRedactor.
loggingBuilder.Services.AddRedaction(x =>
{
//// 👇 Enable the erasing redactor for sensitive data
x.SetRedactor(new DataClassificationSet(Taxonomy.SensitiveData));
{
[SensitiveData]
public string? Name { get; set; }
} `
When I log when using Opentelemetry and a consolexporter, or the jsonconsole the log exist in my console. But not as a log in or example Aspire logs.
Is it intended that logs shall not be exported but only work with the console outputs?


Beta Was this translation helpful? Give feedback.
All reactions