-
Notifications
You must be signed in to change notification settings - Fork 133
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 #330
Support structured logging #330
Conversation
|
Welcome @saku3! |
Hi @saku3. 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. |
dbdf92c
to
5a28102
Compare
/ok-to-test |
5a28102
to
a6a1794
Compare
@@ -112,15 +125,16 @@ func main() { | |||
config, err = rest.InClusterConfig() | |||
} | |||
if err != nil { | |||
klog.Fatal(err.Error()) | |||
klog.ErrorS(err, "Failed to create cluster config") |
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.
Exit is missing here, klog.Fatal
would exit but ErrorS
does not.
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've add klog.FlushAndExit
. Could you please review it again?
a6a1794
to
d1c4427
Compare
/lgtm |
d1c4427
to
3078e4e
Compare
I've resolved the conflicts and pushed the changes according to the guidelines provided below. Could you please give it another look and approve if everything is fine? |
/lgtm |
/retest |
/retest |
I'm getting the same error on multiple PRs in other repositories.
The failing tests are as follows The error is identical.
|
Related to OSS issue: kubernetes/kubernetes#120997 |
3078e4e
to
1e9b0ad
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied, jsafrane, saku3 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 external-resizer container 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
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
related PR:kubernetes-csi/livenessprobe#202
Special notes for your reviewer:
Does this PR introduce a user-facing change?: