-
Notifications
You must be signed in to change notification settings - Fork 52
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
Conversation
Signed-off-by: Shlomit Koyfman <shlomitk@il.ibm.com>
There was a problem hiding this 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 ?
Signed-off-by: Shlomit Koyfman <shlomitk@il.ibm.com>
Set the new logger for klog as well, this will take care of logging done in internal packages that ignore the manager log. |
Signed-off-by: Shlomit Koyfman <shlomitk@il.ibm.com>
pkg/logging/writer.go
Outdated
for key, val := range values { | ||
l = l.Str(key, val) | ||
} | ||
l.Msg(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like in Info.
Signed-off-by: Shlomit Koyfman <shlomitk@il.ibm.com>
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"}