Support json logging format - #1256
Conversation
|
Hi @huww98. 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. DetailsInstructions 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-sigs/prow repository. |
|
/ok-to-test |
|
Can you replace "KEP-2845" in the release notes with a description of what that feature is about? |
Actually already included, that is "Remove klog specific flags". KEP-2845 is just offering more context to the interested reader of the release note. kubernetes-csi/external-resizer#411 contains some more discussion about this change.
Done |
|
@xing-yang Rebased. I think this is the only CSI sidecar that don't support json logging now. Can we merge this so that we can use json logging for the whole CSI driver? |
|
In the PR description, can you add output of the logs before and after your change? |
Done |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: huww98, xing-yang 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Only one line of log is changed to structured logging, to prove the json format works. We can migrate others in the future.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Like: kubernetes-csi/external-resizer#330
Related:
Before:
After:
After and with
--logging-format=json{"ts":1740730756069.866,"caller":"snapshot-controller/main.go:179","msg":"Version","v":0,"version":"unknown"} {"ts":1740730756070.206,"caller":"snapshot-controller/main.go:184","msg":"unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined"}Does this PR introduce a user-facing change?:
KEP-2845: Deprecate klog specific flags in Kubernetes Components