Skip to content

Commit 50771fd

Browse files
authored
Merge pull request #2384 from ViduminiKulathunga/enable-debug-logging-doc
Add instructions for enabling debug logging in the Kubernetes Python
2 parents 2eca99a + 11b9733 commit 50771fd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,20 @@ recreate it between api calls that use _stream_ and other api calls.
236236

237237
See more at [exec example](examples/pod_exec.py).
238238

239+
## Enabling Debug Logging
240+
241+
To enable debug logging in the Kubernetes Python client, follow these steps:
242+
243+
### 1. Import the `logging` module
244+
245+
```python
246+
import logging
247+
248+
# Set the logging level to DEBUG
249+
logging.basicConfig(level=logging.DEBUG)
250+
251+
# To see the HTTP requests and responses sent to the Kubernetes API (for debugging network-related issues), configure the urllib3 logger:
252+
logging.getLogger("urllib3").setLevel(logging.DEBUG)
253+
```
254+
239255
**[⬆ back to top](#Installation)**

0 commit comments

Comments
 (0)