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

auth_opt_log_level does not work #273

Open
eydonmlau opened this issue Apr 19, 2023 · 2 comments
Open

auth_opt_log_level does not work #273

eydonmlau opened this issue Apr 19, 2023 · 2 comments

Comments

@eydonmlau
Copy link

Hi, When I set auth_opt_log_level in conf such like auth_opt_log_level debug, it doesn't work, it use the default info level.
Is it need to add log.SetLevel(authPlugin.logLevel) at

@iegomez
Copy link
Owner

iegomez commented Apr 19, 2023

Yeah, that sounds like a regression when refactoring some backends to receive the log level.
I don't have the time right now, but I'll look into fixing it when I do.

@iegomez
Copy link
Owner

iegomez commented May 18, 2023

@eydonmlau I checked and though the level is not set there, the logLevel option is passed to every backend initializer.
Now, there are some odd things I found:

  • For some reason GRPC backend is not setting it, but it's only logging warnings and errors, so the default info level should be enough.
  • JWT'S JS and Remote checkers don't expect it, but the general JWT backend initializer is setting the passed level that should cover it: https://github.com/iegomez/mosquitto-go-auth/blob/master/backends/jwt.go#L41
  • Neither go-auth.go nor backends.go set it, but since any debug logging seems to be done after backends have been initialized (e.g., when checking auth or acl), the level should already be set.

Now, I don't remember what was the rationale behind passing a level to each backend, maybe it had to do with tests or something like that. Since there's a single option, I don't see why we need it. But, as I said, it should still work so I'm curious what's your setup and which logs are you missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants