karmada
karmada copied to clipboard
Support Karmada components output the log by using json format
What would you like to be added:
We have introduced k8s.io/component-base/cli at 2049 and add json log register to imports.
But json log register (_ "k8s.io/component-base/logs/json/register") does not work because we do not apply the log flags yet.
So we can not use the flags --log-format=json
to output karmada components logs by using json format.
Like
Why is this needed: Introduce json format log to karmada components
But json log register (_ "k8s.io/component-base/logs/json/register") does not work because we do not apply the log flags yet. So we can not use the flags --log-format=json to output karmada components logs by using json format.
Do you mean we need to introduce a new flag --log-format
?
But json log register (_ "k8s.io/component-base/logs/json/register") does not work because we do not apply the log flags yet. So we can not use the flags --log-format=json to output karmada components logs by using json format.
Do you mean we need to introduce a new flag
--log-format
?
--log-format
can be worked if we bound k8s.io/component-base/logs
configuration with flags like k8s
Even though-log-format
is optional because the value is always text
if we do not set it to json
If you think we do not need to introduce this, we may delete the imports _ "k8s.io/component-base/logs/json/register"
introduced by 2049
I don't know if we really need the json format logs for now.
@lonelyCZ what's your opinion?
This is a feature provided by k8s.io/component-base/logs
, I think it should be useful for specific users.
But we don't seem to have this need right now, I think if it is not complex, we can support it, or we will do it when real users ask this feature.
As a lack of activity, let's close this first, feel free to reopen it if you still need it. /close
@XiShanYongYe-Chang: Closing this issue.
In response to this:
As a lack of activity, let's close this first, feel free to reopen it if you still need it. /close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Mild bump!
It would be great if Karmada supports json log format, as Kubernetes supports it in 1.19. Can we have a --logging-format=json
flag that change the format of logs from klog native format to JSON format?
Our use case is we ship all karmada logs to Datadog (it automatically parses JSON-formatted logs) and soon reach the quota. We want to analyze logs then drop logs in certain patterns. For now, we have to have parser that datadog provide for glog format. It will bring values for us but low priority.
@yizhang-zen Thanks for your feedback. /reopen
@XiShanYongYe-Chang: Reopened this issue.
In response to this:
@yizhang-zen Thanks for your feedback. /reopen
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.