Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 11b9733

Browse filesBrowse files
Add instructions for enabling debug logging in the Kubernetes Python client
1 parent bd32360 commit 11b9733
Copy full SHA for 11b9733

File tree

1 file changed

+16
-0
lines changed
Filter options

1 file changed

+16
-0
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+16
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.