You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Enabling Debug Logging in Kubernetes Python Client
2
+
3
+
This document describes how to enable debug logging, view logged information, and provides examples for creating, patching, and deleting Kubernetes resources.
4
+
5
+
## 1. Why Enable Debug Logging?
6
+
7
+
Debug logging is useful for troubleshooting as it shows details like HTTP request and response headers and bodies. These details can help identify issues during interactions with the Kubernetes API server.
8
+
9
+
---
10
+
11
+
## 2. Enabling Debug Logging
12
+
13
+
To enable debug logging in the Kubernetes Python client, follow these steps:
14
+
15
+
1.**Modify the Configuration Object:**
16
+
Enable debug mode by setting the `debug` attribute of the `client.Configuration` object to `True`.
17
+
18
+
2.**Example Code to Enable Debug Logging:**
19
+
Below is an example showing how to enable debug logging:
20
+
```python
21
+
from kubernetes import client, config
22
+
23
+
# Load kube config
24
+
config.load_kube_config()
25
+
26
+
# Enable debug logging
27
+
c = client.Configuration()
28
+
c.debug =True
29
+
30
+
# Pass the updated configuration to the API client
0 commit comments