Allow configuration of different log formats: text, json#4803
Allow configuration of different log formats: text, json#4803estesp merged 1 commit intocontainerd:masterfrom ungureanuvladvictor:vladu/json-logging
Conversation
|
Hi @ungureanuvladvictor. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Build succeeded.
|
|
Build succeeded.
|
|
Build succeeded.
|
|
LGTM, but please consider squashing commits |
|
Build succeeded.
|
Could we remove this part? |
Signed-off-by: Vlad Ungureanu <[email protected]>
|
@fuweid -- addressed your comment! |
|
Build succeeded.
|
|
I recompiled and replaced the containerd of the node, and then restarted the containerd service. However, the container log is still in text format and has not been changed to json format. I adjusted this part of the configuration: |
|
Hi @ungureanuvladvictor, I am new to using containerd and am also trying to change the logging output to JSON. I am using containerd v1.5.6 and edited the debug block as you suggested and I am not seeing JSON output in /var/log/containers/<container.log>. Am i misunderstanding what this enhancement does? I also have not been able to find any documentation on this new setting. Any help would be appreciated. Thanks! |
|
@bekirby -- this feature is for the logs of |
|
@ungureanuvladvictor just happened to be on and saw your reply - thank you. Is it possible to change the log format of the containers do you know? We are switching from Docker to containerd and that is one of the problems we are facing. |
|
As far as I know this is not possible right now but I'd suggest asking this on the #containerd slack chan -- maybe more folks know this. Some relevant issues + links: |
|
Thank you very much for the info! |
|
I think to do plug-able logging format for kubelet CRI containers we would need a KEP see github.com/kubernetes/enhancements |
This PR allows configuring logrus to output in 2 different formats:
The way I've configured this is to be via the
debugsection in the toml config. I did not add a CLI flag for this, curious if you folks think this would be useful here. In my experience I've found all my interactions with containerd via the toml config.