From 11b9733789abaf8f688f67b8eb1635504d92c4f5 Mon Sep 17 00:00:00 2001 From: ViduminiKulathunga Date: Wed, 9 Apr 2025 09:39:11 +0200 Subject: [PATCH] Add instructions for enabling debug logging in the Kubernetes Python client --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 18b916eb77..73c7537500 100644 --- a/README.md +++ b/README.md @@ -236,4 +236,20 @@ recreate it between api calls that use _stream_ and other api calls. See more at [exec example](examples/pod_exec.py). +## Enabling Debug Logging + +To enable debug logging in the Kubernetes Python client, follow these steps: + +### 1. Import the `logging` module + +```python +import logging + +# Set the logging level to DEBUG +logging.basicConfig(level=logging.DEBUG) + +# To see the HTTP requests and responses sent to the Kubernetes API (for debugging network-related issues), configure the urllib3 logger: +logging.getLogger("urllib3").setLevel(logging.DEBUG) +``` + **[⬆ back to top](#Installation)**