New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoggerMessage / LogProperties logs Object type instead of value for properties when Redaction is disabled. #5163
Comments
Hello @sjwaight, if you don't call either |
Tagging subscribers to this area: @dotnet/area-extensions-logging |
Thanks @xakep139. In order to resolve this issue I would need to:
Is this right? I'm using this site as a reference. |
Apologies for the confusion, I took a closer look to the issue and ran the code locally. The default .NET's @geeknoid I believe this is intended behavior, can you please confirm that? |
@xakep139 |
Description
When using the Redaction libraries with the LoggerMessage / LogProperties I had expected that disabling Redaction would cause any property marked with redaction attributes would simply be logged in the clear. Instead, the logger appears to log the Redaction Attribute Object Type and not the underlying property value.
Reproduction Steps
Consider this sample .NET Azure Function: https://github.com/sjwaight/azure-functions-net-log-redaction
When redaction is enabled ("EnableRedaction" set to 'true' or missing in
local.settings.json
) the following appears in the console logs:Now, if we disable Redaction (which removes the Redaction extension from Logging and Services) instead of seeing the clear text values for previously redacted properties we see:
Expected behavior
Expected that with redaction disabled that the output would be:
Actual behavior
Property values are not captured in clear text.
Regression?
Unknown as just starting to use extensions.
Known Workarounds
None that I'm aware of.
Configuration
Running on Ubuntu Linux 22.04
.NET SDK:
Version: 8.0.203
Commit: 5e1ceea679
Workload version: 8.0.200-manifests.4e94be9c
Runtime Environment:
OS Name: ubuntu
OS Version: 22.04
OS Platform: Linux
RID: linux-x64
Base Path: /usr/share/dotnet/sdk/8.0.203/
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.3
Architecture: x64
Commit: 9f4b1f5d66
.NET SDKs installed:
6.0.415 [/usr/share/dotnet/sdk]
8.0.203 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.23 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.23 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Other information
No response
The text was updated successfully, but these errors were encountered: