Skip to content

Root Logger being using the Leaderelection module #2364

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

Open
jordantshaw opened this issue Feb 27, 2025 · 2 comments
Open

Root Logger being using the Leaderelection module #2364

jordantshaw opened this issue Feb 27, 2025 · 2 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.

Comments

@jordantshaw
Copy link

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)
@jordantshaw jordantshaw added the kind/bug Categorizes issue or PR as related to a bug. label Feb 27, 2025
@yliaog
Copy link
Contributor

yliaog commented Mar 12, 2025

/help

@k8s-ci-robot
Copy link
Contributor

@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:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

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:

/help

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.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants