Skip to content

[Question]: Can we prevent Result from Logging even if Debug is turned on? #2585

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

Open
chris-a-hammons opened this issue Apr 10, 2025 · 3 comments
Labels

Comments

@chris-a-hammons
Copy link

What are you wanting to achieve?

Is there a way to be able to not allow logging of Result even if the log level debug/trace is turned on?

I generally worry about logging Results from any library since it could easily contain an object or string with Sensitive data. We cannot rely on Debug being turned off since support and developers can escalate logging in our system.

What code or approach do you have so far?

I have been looking at code, but cannot identify a way to be able to do what I am asking.

Additional context

No response

@martincostello
Copy link
Member

Does #2072 solve this for you? (Added in 8.4.0)

@chris-a-hammons
Copy link
Author

@martincostello I do not believe so that ticket is meant to change the Severity/Loglevel, not make sure that the value of Result is Never logged. For example we have a Polly that ends up with a string that is JWT token which I NEVER want logged even if Debug is turned on. It is currently logging the JWT token in the Result.

@martincostello
Copy link
Member

OK, in that case my initial two suggestions are:

  1. Add a log filter in your code to find such log messages and run your own filtering logic
  2. Look into using log redaction to do the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants