Skip to content
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

Log levels broken #292

Closed
invidian opened this issue Jan 21, 2020 · 1 comment · Fixed by #310
Closed

Log levels broken #292

invidian opened this issue Jan 21, 2020 · 1 comment · Fixed by #310
Assignees
Labels
bug Something isn't working

Comments

@invidian
Copy link

What happened

It seems that since fe3dba9, --log DEBUG has no effect when running kube-hunter.

Steps to reproduce:

  1. Checkout repository
  2. docker run -it $(docker build . | tail -n 1 | cut -d" " -f3) --log DEBUG --pod

Reverting to fd4d79a restores proper logging behavior.

Expected behavior

Debug messages should show up when --log DEBUG is specified.

@iyehuda
Copy link
Contributor

iyehuda commented Feb 16, 2020

Hi @invidian !

Thanks for reporting!
This is surely a regression since #283.
The bug origins in a call to logging.basicConfig being done before the configuration set.
We should avoid using logging default logger and use a custom one to prevent unexpected behavior.

@iyehuda iyehuda self-assigned this Feb 16, 2020
iyehuda added a commit to iyehuda/kube-hunter that referenced this issue Feb 20, 2020
Remove unnecessary imports from kube_hunter/__init__.py that cause
hook registration before main file execution.
This made the event loop handler indirectly configure the root logger,
which in turn prevented the main file configuring it with user parameters.

Fixes aquasecurity#292
This was referenced Feb 20, 2020
iyehuda pushed a commit that referenced this issue Feb 25, 2020
Reorganize config files, and argparse.
Resolves #289
Resolves #292
py-go pushed a commit to py-go/kube-hunter that referenced this issue Aug 29, 2021
Resolves: aquasecurity#292

Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants