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

inconsistent log output format #3550

Open
seankhliao opened this issue Mar 9, 2021 · 3 comments · May be fixed by #8450
Open

inconsistent log output format #3550

seankhliao opened this issue Mar 9, 2021 · 3 comments · May be fixed by #8450

Comments

@seankhliao
Copy link

seankhliao commented Mar 9, 2021

What steps did you take and what happened:

k8s.io/client-go writes out logs through k8s.io/klog{,/v2} in a different format than the rest of the application (logfmt or json) making it more difficult to parse, example:

time="2021-03-09T08:12:51Z" level=info msg="No backup locations were ready to be verified" controller=backupstoragelocation logSource="pkg/controller/backupstoragelocation_controller.go:120"
I0309 08:13:16.387907       1 request.go:621] Throttling request took 1.058190834s, request: GET:https://10.250.0.1:443/apis/autoscaling.k8s.io/v1?timeout=32s
time="2021-03-09T08:13:50Z" level=info msg="Checking for existing backup locations ready to be verified; there needs to be at least 1 backup location available" controller=backupstoragelocation logSource="pkg/controller/backupstoragelocation_controller.go:58"

What did you expect to happen:

logs output in a consistent format

Anything else you would like to add:

Environment:

  • Velero version (use velero version): 1.5.3

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"

requires: #8442

@eleanor-millman eleanor-millman added the Icebox We see the value, but it is not slated for the next couple releases. label May 12, 2021
@dsu-igeek dsu-igeek added Reviewed Q2 2021 and removed Icebox We see the value, but it is not slated for the next couple releases. labels May 12, 2021
@kaovilai
Copy link
Member

Velero need to bump

velero/go.mod

Line 55 in 9f0026d

k8s.io/client-go v0.30.5

to v0.31.0 or above which contains kubernetes/client-go@75fea27 which will allow us to set klog.SetLogger() which should solve this problem.

some examples

@kaovilai
Copy link
Member

My team's goal is to enable all logs to be in json formatting which requirement is a subset that aligns with this issue IMO.

@kaovilai
Copy link
Member

FormatText Format = "text"
FormatJSON Format = "json"
defaultValue Format = FormatText

these flags should apply to logs coming from client-go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants