-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Output the http REST communication to the log #2526
Comments
We'll also check if OkHTTP logging can be configured to print those messages. |
I checked code and looks like we're already using okhttp Lines 158 to 163 in 579d972
If I set logging level to org.slf4j.simpleLogger.defaultLogLevel=trace If I execute some code like this: try (OpenShiftClient client = new DefaultOpenShiftClient()) {
SelfSubjectAccessReview ssar = new SelfSubjectAccessReviewBuilder()
.withNewSpec()
.withNewResourceAttributes()
.withGroup("apps")
.withResource("deployments")
.withVerb("create")
.withNamespace("rokumar")
.endResourceAttributes()
.endSpec()
.build();
ssar = client.authorization().v1().selfSubjectAccessReview().create(ssar);
} It produces the following log:
I think all we need to do is to document this :-) . Maybe we can add a section in our CHEATSHEET about it? |
@jonathanvila : Hi, Would you like to contribute a PR for this? I think it would be awesome if you could submit a Doc improvement PR to address this issue? |
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions! |
Hey, can you pls help me in this issue as following through previous conversations we need to just document this feature in cheatsheet but exactly where? |
@MUzairS15 : You can create a Logging section there and add instructions on how to configure logging. |
Ok |
One check is failing but it is not required , also if there is any other change needed. |
@rohanKanojia help?? |
I've restarted the flaky test failure. I've also posted a comment on your PR |
…cedOperation in RbacAPIGroupClient * Fixes #2526 Updated CHEATSHEET.md Added example for how to configure okhttp logging-interceptor. * Updated PR * Updated changes * Changed clusterRoleBindings and clusterRoles to return NonNamespace Operation instead of Mixed operation * Changed clusterRoleBindings and clusterRoles to return NonNamespace Operation instead of Mixed operation
How come the logs using okhttp logging-interceptor do not follow the same logging configuration as logs from the kubernetes-client itself? For example, In this comment #2526 (comment), the first two logs follow the intended pattern of:
But then all the okhttp logs don't follow
How can I change the format of the okhttp logs? |
I'm not sure how to change the format for okhttp logs. Do you think there is some configuration option in HttpLoggingInterceptor[0] to tweak network log output? |
As documentation is not updated atm, for other people - I am using version 6.8.1 and the next change in logging shows Rest communication |
In order to see messages sent and received from/to the K8s client and debug possible issues, having all the http requests to K8s API logged it's interesting. Having the endpoint, and payload sent/received and http headers.
The text was updated successfully, but these errors were encountered: