Various logging improvements in the apiserver #6432
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change contains a bunch of small improvements to the logs generated by API connections and logins. These are all things that have been annoying me for a long time. The goal was to remove unnecessary noise, use more appropriate log levels and provide more useful information.
The logs for a typical client API connection and request now look like:
The start of an agent connection now looks like:
rpc: Reduce codec close error log level
It's quite common for close of the codec to return a "broken pipe"
error. It happens for even API request from the client because the
client typically closing the connection after making a single API
request. There is no need to include these at INFO every time.
apiserver/observer: Reduce API conn log levels
The start and end of every API connection was being logged at INFO. This
is not generally useful to the average user and is strange when view
logs at INFO because all you see is "API connection from ... ", followed
by "API connection terminated..." with nothing in between.
These messages have been lowered to DEBUG so that they're at the same
level as the other API handling log output.
apiserver: Stop logging host ports
For some reason we are logging the API server host ports as part of
every login. This isn't useful and just adds noise to the logs.
apiserver: Rearrange login logs
Removed logging during model validation/state lookup in favour of more
dense log lines post Login. This results in one less log line for user
logins and more informative log lines for all login types.
apiserver: Removed debuglog handler log output
It's not terribly important to know that this handler has started.
QA
Examined API server logs to see expected, improved log output.