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

Use JSON logger with ISO8601 time encoder for controller manager #525

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

shreyas-s-rao
Copy link
Contributor

@shreyas-s-rao shreyas-s-rao commented Feb 10, 2023

How to categorize this PR?

/area logging
/kind bug
/needs cherry-pick

What this PR does / why we need it:
Recently merged PR #450 bumped controller-runtime version from v0.10.2 to v0.13.0, which changed the default logging behavior for the logger provided for the controllers to print epoch timestamps in the logs which are not human-readable, as is pointed out by kubernetes-sigs/controller-runtime#2024.

This PR explicitly sets the logger options to use ISO8601 timestamps for the controller logs, as well as switches the logger from dev mode to json mode, ie, structured logging, for better integration with logging stack in production environments.

Which issue(s) this PR fixes:
Fixes partially #524

Special notes for your reviewer:
/cc @unmarshall @rfranzke

Release note:

Explicitly set logging options to use JSON logging and ISO8601 timestamp format.

@shreyas-s-rao shreyas-s-rao added this to the v0.16.0 milestone Feb 10, 2023
@shreyas-s-rao shreyas-s-rao requested a review from a team as a code owner February 10, 2023 12:17
@gardener-robot gardener-robot added area/logging Logging related kind/bug Bug needs/cherry-pick Needs to be cherry-picked to older version needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) labels Feb 10, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 10, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 10, 2023
@shreyas-s-rao
Copy link
Contributor Author

/reviewed ok-to-test

@gardener-robot gardener-robot added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 10, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 10, 2023
@shreyas-s-rao shreyas-s-rao added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 10, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 10, 2023
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Feb 10, 2023
main.go Outdated Show resolved Hide resolved
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 12, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 12, 2023
@shreyas-s-rao
Copy link
Contributor Author

@unmarshall thanks for your suggestion. I've incorporated it now. PTAL

@shreyas-s-rao
Copy link
Contributor Author

/remove needs/cherry-pick

@gardener-robot gardener-robot removed the needs/cherry-pick Needs to be cherry-picked to older version label Feb 13, 2023
@ishan16696
Copy link
Member

needs/cherry-pick

Do we have a plan to release v0.15.4 ? sorry I'm aware of any such plan, I thought we will release this in v0.16.0

@shreyas-s-rao
Copy link
Contributor Author

Do we have a plan to release v0.15.4 ? sorry I'm aware of any such plan, I thought we will release this in v0.16.0

@ishan16696 yes, that's the reason I removed the needs/cherry-pick label

@shreyas-s-rao shreyas-s-rao merged commit 56fbc66 into gardener:master Feb 15, 2023
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Feb 15, 2023
@shreyas-s-rao shreyas-s-rao deleted the fix/log-encoder branch February 15, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging Logging related kind/bug Bug needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review size/xs Size of pull request is tiny (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants