-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support structured logging #349
Conversation
Hi @rlia. Thanks for your PR. I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/lgtm |
Thanks a lot ! |
I am sorry, @rlia can you please rebase? |
538c666
to
dc23d0e
Compare
@rlia another release, can you please rebase again? I promise I will merge it this time :-) |
In addition, can you please add logcheck to |
[IMHO] This PR addresses structured logging, but contextual logging is not yet supported. Alternatively, it might be a good idea to keep this PR focused on addressing structured logging only, and create a separate PR to handle contextual logging. |
ack, feel free to focus at structured logging |
Makefile
Outdated
@@ -18,3 +18,5 @@ CMDS=csi-node-driver-registrar | |||
all: build | |||
|
|||
include release-tools/build.make | |||
|
|||
test: test-logcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need more changes in the PR. As @bells17 pointed out, we should focus on the structured logging and not add test-logcheck
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was mistaken. . I deleted the line.
/lgtm |
Thanks for your patience! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane, rlia The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
In this PR I have added JSON logging.
With this change, it is now possible to output the logs of the node-driver-register in JSON format.
Running the container with the --logging-format=json option will output the logs in JSON format.
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 update 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 #228
Special notes for your reviewer:
Does this PR introduce a user-facing change?: