Support structured logging#149
Conversation
|
Skipping CI for Draft Pull Request. |
c70e72e to
6506672
Compare
pohly
left a comment
There was a problem hiding this comment.
Instead of "just" doing structured logging, would it be possible to also do contextual logging, i.e. remove the dependency on the global logger?
This makes libraries more versatile.
9646445 to
0a4fcff
Compare
0a4fcff to
f942a75
Compare
|
@pohly Thank you for your review.
I've made an attempt to incorporate contextual logging as well. Could you please review it again? I have also confirmed that the following tests with logcheck pass: |
1b7a924 to
5767ec6
Compare
|
@pohly Thank you for the review. |
pohly
left a comment
There was a problem hiding this comment.
Some small nits, but overall this looks good.
44a5b52 to
7308f09
Compare
|
@pohly Thank you for the improvement suggestions. I've updated the implementation accordingly. |
|
/lgtm @bells17: can you squash into one commit? |
6e6f23e to
ca88d98
Compare
|
@pohly Thank you for the review and lgtm! |
|
/lgtm For approval. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bells17, jsafrane The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…-logging Support structured logging
Version 0.18.0 of github.com/kubernetes-csi/csi-lib-utils added support for structured logging. This commit includes passing the context parameter for the necessary function. ref: kubernetes-csi/csi-lib-utils#149 Signed-off-by: Praveen M <m.praveen@ibm.com>
Version 0.18.0 of github.com/kubernetes-csi/csi-lib-utils added support for structured logging. This commit includes passing the context parameter for the necessary function. ref: kubernetes-csi/csi-lib-utils#149 Signed-off-by: Praveen M <m.praveen@ibm.com>
Version 0.18.0 of github.com/kubernetes-csi/csi-lib-utils added support for structured logging. This commit includes passing the context parameter for the necessary function. ref: kubernetes-csi/csi-lib-utils#149 Signed-off-by: Praveen M <m.praveen@ibm.com>
What type of PR is this?
/kind feature
What this PR does / why we need it:
I've updated the klog functions used within csi-lib-utils to structured logging functions, following the guidelines below:
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md
Several CSI Sidecars like external-snapshotter rely on csi-lib-utils, and to fully support structured logging in these Sidecars, it's necessary for csi-lib-utils to adopt structured logging as well.
In addition, I've modified the log messages based on the following guideline:
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#remove-string-formatting-from-log-message
I’ve updated the klog functions in use according to the guidelines provided below, and I've confirmed that they pass the logcheck tests:
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#change-log-functions
Which issue(s) this PR fixes:
Fixes #150
Special notes for your reviewer:
Does this PR introduce a user-facing change?: