8000 Preserve logging format in manager by shlomitk1 · Pull Request #1697 · fybrik/fybrik · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Preserve logging format in manager #1697

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

Merged
merged 10 commits into from
Aug 21, 2022
Merged

Preserve logging format in manager #1697

merged 10 commits into from
Aug 21, 2022

Conversation

shlomitk1
Copy link
Contributor

Signed-off-by: Shlomit Koyfman shlomitk@il.ibm.com
Fixes #1399

This PR changes the logging format of controller-runtime packages from
2022-03-31T08:02:54.666Z INFO controller-runtime.webhook serving webhook server {"host": "", "port": 9443}
to
{"level":"info","Caller":"controller-runtime.webhook","host":"","port":"9443","time":"2022-08-17T14:23:24Z","message":"Serving webhook server"}

Signed-off-by: Shlomit Koyfman <shlomitk@il.ibm.com>
Copy link
Collaborator
@roytman roytman left a comment

Choose a reason for hiding this comment

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

Still there are messages like

I0819 15:44:00.708146       1 request.go:665] Waited for 1.136695625s due to client-side throttling, not priority and fairness, request: GET:https://10.96.0.1:443/apis/policy/v1beta1?timeout=32s

I0819 15:44:23.037100       1 leaderelection.go:258] successfully acquired lease fybrik-system/fybrik-operator-leader-election

maybe it's hard to eliminate them completely

The biggest issue here that you wrong the Caller tag.
in the fybrik messages, the caller (lower case) is the file name and line where the message was generated.

{"level":"trace","Setup":"main","local charts dir":"","time":"2022-08-19T15:44:04Z","caller":"/Users/alexey/goWork/src/github.com/fybrik/fybrik/manager/main.go:222","message":"creating Blueprint controller"}```

in the new logger Caller is like "callerType" in the fybrik logger.

{"level":"info","reconciler group":"app.fybrik.io","reconciler kind":"FybrikModule","Caller":"controller.fybrikmodule","time":"2022-08-19T15:44:23Z","message":"Starting Controller"}

maybe rename it to CallerType ?
can we print the file/line of the caller ?

@shlomitk1
Copy link
Contributor Author

Set the new logger for klog as well, this will take care of logging done in internal packages that ignore the manager log.
Changed "Caller" to "setup", made tags in small letters for consistency.

Signed-off-by: Shlomit Koyfman <shlomitk@il.ibm.com>
for key, val := range values {
l = l.Str(key, val)
}
l.Msg(msg)
Copy link
Collaborator

Choose a reason for hiding this comment

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

like in Info.

@shlomitk1 shlomitk1 merged commit d8c3a39 into fybrik:master Aug 21, 2022
@shlomitk1 shlomitk1 deleted the log branch August 21, 2022 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Different log formats of the Fybrik manager
2 participants
0