Skip to content
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

Add support for JSON logging format #456

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Jun 11, 2024

This is basically a rip-off of cert-manager/trust-manager#354 adding support for structured logging (JSON) based on slog.

@cert-manager-prow cert-manager-prow bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 11, 2024
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
Copy link
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

This took me a bit longer to get around to than I expected this morning, sorry!

I installed from this branch to a local cluster and confirmed it worked as expected:

$ k logs -n cert-manager cert-manager-approver-policy-6dd9c85466-frl2r
{"time":"2024-06-11T14:51:47.861650007Z","level":"INFO","msg":"cache not synced yet, skipping metrics approverpolicy_certificaterequest_*","logger":"metrics"}
{"time":"2024-06-11T14:51:47.861737215Z","level":"INFO","msg":"registering webhook endpoints","logger":"webhook"}
{"time":"2024-06-11T14:51:47.861751674Z","level":"INFO","msg":"skip registering a mutating webhook, object does not implement admission.Defaulter or WithDefaulter wasn't called","logger":"controller-manager/controller-runtime/builder","GVK":{"Group":"policy.cert-manager.io","Version":"v1alpha1","Kind":"CertificateRequestPolicy"}}
{"time":"2024-06-11T14:51:47.86179009Z","level":"INFO","msg":"Registering a validating webhook","logger":"controller-manager/controller-runtime/builder","GVK":{"Group":"policy.cert-manager.io","Version":"v1alpha1","Kind":"CertificateRequestPolicy"},"path":"/validate-policy-cert-manager-io-v1alpha1-certificaterequestpolicy"}
{"time":"2024-06-11T14:51:47.861854465Z","level":"INFO","msg":"Registering webhook","path":"/validate-policy-cert-manager-io-v1alpha1-certificaterequestpolicy","logger":"controller-manager/controller-runtime/webhook"}
...

Thanks for this!

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SgtCoDFish

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2024
@SgtCoDFish
Copy link
Member

/test pull-cert-manager-approver-policy-test

Flake!

@cert-manager-prow cert-manager-prow bot merged commit bb40c9b into cert-manager:main Jun 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants