Skip to content

Add instructions for enabling debug logging in the Kubernetes Python #2384

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)**