Open
Description
What happened (please include outputs or screenshots):
It appears that the leaderelectoin module is logging directly to the root logger logging.info(...)
This is problematic when trying to change the log level of the kubernetes logs.
You can see here "root" is being displayed as the logger name. So I am not able to specifically change the log level of the kubernetes logs without changing the loglevel for all log messages.
[2025-02-27 13:27:59,818] [INFO] [root] yet to finish lease_duration, lease held by dc6e7813-2f8a-4428-a21c-00670c6543da and has not expired
What you expected to happen:
I would expect to be able to configure the loglevel using something like below, however it has no affect.
logging.getLogger('kubernetes').setLevel(logging.ERROR)
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
- Kubernetes version (
kubectl version
): client v1.30.5, server v1.32.0 - OS (e.g., MacOS 10.13.6): MacOS 15.3.1
- Python version (
python --version
) 3.12.6 - Python client version (
pip list | grep kubernetes
)
Activity
yliaog commentedon Mar 12, 2025
/help
k8s-ci-robot commentedon Mar 12, 2025
@yliaog:
This request has been marked as needing help from a contributor.
Guidelines
Please ensure that the issue body includes answers to the following questions:
For more details on the requirements of such an issue, please see here and ensure that they are met.
If this request no longer meets these requirements, the label can be removed
by commenting with the
/remove-help
command.In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.