-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Decouple decision_logs.console from general log level #2733
Comments
It would be kind of cool if we had the option to set them at their own level, sort of to your point that if they are enabled they should show up regardless of overall log level setting. Unfortunately it doesn't seem like Logrus supports that :( One pretty easy approach would be to make it configurable, something like: decision_logs:
console: true
console_log_level: warn (or something like that) That way we don't have to try and pick a level automatically (or make deployers try and figure out where they would go, they can set it and be confident in what level they'll show up at) |
I think we should be able to create a new We'll need some way to plumb the log format (and any other log options we introduce in the future) into the decision logger implementation. I prefer this approach because then we don't have to introduce another configuration option that users need to be aware of. |
Agreed - if setting |
We should probably do the same for the status plugin (which also supports console logging). This way users could just run OPA with |
This allows logging to console for decisions and status (and possibly other use cases) without having to follow the generic --log-level. Fixes open-policy-agent#2733 Signed-off-by: Anders Eknert <anders.eknert@bisnode.com>
This allows logging to console for decisions and status (and possibly other use cases) without having to follow the generic --log-level. Fixes #2733 Signed-off-by: Anders Eknert <anders.eknert@bisnode.com>
It looks we have a regression in v0.29.4. W/ v0.28.0 this works fine:
In another terminal run
With v0.29.4 no log gets emitted. I'm guessing the SDK changes are to blame. |
I'm going to open a new issue to track the bug. |
Expected Behavior
Setting
decision_logs.console=true
intuitively means "I want my decisions printed to console", and this is what I would expect regardless of the "application" log level setting.Actual Behavior
decision_logs.console=true
currently works only if--log-level
is set to INFO or DEBUG.Steps to Reproduce the Problem
Start server with
decision_logs.console=true
and--log-level=error
.Additional Info
I've seen mentions of this here and there but could not find a ticket for tracking this.
One thing I'll want to note here is that I think the question of the "access logs" currently printed on INFO is a separate issue - if
decision_logs.console=true
is set it should be respected regardless of--log-level
IMO.The text was updated successfully, but these errors were encountered: