-
Notifications
You must be signed in to change notification settings - Fork 802
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
Use appropriate log level for errors #2025
Comments
The main concern here is that we don't want to log anything at the Error level that is caused by an external entity that you can't do anything about, that floods logs unnecessarily. Errors should be actionable within the current app. Timeouts, disconnects, etc. are all expected within normal proxy operations. To look at the proxy results and decide which ones you want to react to check here: |
Triage:
We'd accept changing this log to Warning. It is a one-line change in reverse-proxy/src/ReverseProxy/Forwarder/HttpForwarder.cs Lines 992 to 993 in 03a4d6a
@kheardCB are you interested in submitting a PR for it? Simple to do, brings value and more sanity. We should do it in 2.x. |
@karelz Sure, I can submit a PR. |
Great, looking forward to it @kheardCB! Let us know if you hit any roadblocks, we will be happy to help. |
In the HttpForwarder, the log level for errors is Information. Can this be changed to Error? This may be an issue in other log messages in other files, but this is the main one I noticed.
reverse-proxy/src/ReverseProxy/Forwarder/HttpForwarder.cs
Line 757 in 5210218
Background:
I am using Serilog for logging and setting the MinimumLevel override for "Microsoft.AspNetCore" and "Yarp.ReverseProxy.Forwarder" to Warning. This accompanied with the "UseSerilogRequestLogging" option allows the service to omit one log line per request. In this setup, any errors are not being logged because they are set as Information, not Error.
I would gladly make the change myself and create a Pull Request, if that would be helpful.
The text was updated successfully, but these errors were encountered: