Open mikyll opened 4 months ago
@Edmond-J-A @rushitote @techoner
@mikyll why do you want to do this? Can't turn off after creation?
@hsluoyz Since we have hundreds if not thousands of policy entries, I would like to make that logging entires configurable, in order to make it more readable. Moreover, in our plugin, the enforcer reloads the policies each time the plugin configuration changes, and that would add a lot of logging entries, making it harder to debug Kong-related issues
In short, it's just a matter of preference, so I'd just like to know if it's possible, and in case how 🙂
@mikyll see how Go Casbin does this: https://github.com/casbin/casbin
I'm using casbin in a Custom Kong plugin, and I'm getting these log entries when loading the model and policy:
Goal: I'd like to enable/disable these log messages, based on a plugin configuration parameter (
conf.debug
).I see that there is a enableLog() method, but is there a way to disable logs before creating the enforcer itself?
My code is basically this: