-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Improving logging level for "not found" log message #44997
Comments
The offending code: moby/api/server/router/swarm/cluster_routes.go Lines 195 to 199 in c910e47
|
Yes, debug would probably be fine for this. Probably quite off-topic (and orthogonal), but I'm almost inclined to remove (some of? haven't looked what other logs there are) these altogether. That said, at times when debugging, I would've loved for an option that logged both requests and responses (or at least status of responses). Wondering if something like that could be part of (or similar to); moby/api/server/middleware/debug.go Line 17 in b8b68e6
|
The errors are already returned to the client in the API response, so logging them to the daemon log is redundant. Log the errors at level Debug so as not to pollute the end-users' daemon logs with noise. Refactor the logs to use structured fields. Add the request context to the log entry so that logrus hooks could annotate the log entries with contextual information about the API request in the hypothetical future. Fixes moby#44997 Signed-off-by: Cory Snider <csnider@mirantis.com>
The errors are already returned to the client in the API response, so logging them to the daemon log is redundant. Log the errors at level Debug so as not to pollute the end-users' daemon logs with noise. Refactor the logs to use structured fields. Add the request context to the log entry so that logrus hooks could annotate the log entries with contextual information about the API request in the hypothetical future. Fixes moby#44997 Signed-off-by: Cory Snider <csnider@mirantis.com> (cherry picked from commit a4e3c67) Signed-off-by: Cory Snider <csnider@mirantis.com>
The errors are already returned to the client in the API response, so logging them to the daemon log is redundant. Log the errors at level Debug so as not to pollute the end-users' daemon logs with noise. Refactor the logs to use structured fields. Add the request context to the log entry so that logrus hooks could annotate the log entries with contextual information about the API request in the hypothetical future. Fixes moby#44997 Signed-off-by: Cory Snider <csnider@mirantis.com> (cherry picked from commit a4e3c67) Signed-off-by: Cory Snider <csnider@mirantis.com>
Description
Currently the logging level for for "not found" log message is
error
level. E.g.Jan 23 20:33:17 localhost dockerd: time="2022-01-23T20:33:17.023933784Z" level=error msg="Error getting service <service-name>: service <service-name> not found"
This is regarded as spam logs if an application periodically checks the existence of that service to determine the next steps, in this case, "the service does not exist" is not a real error for users.
Is it possible to change the logging level to
info
for this kind of log messages?Reproduce
Expected behavior
No response
docker version
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: