You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
local CustomHandler = {
NAME = "my-plugin",
PRIORITY = 1000,
VERSION = "0.1",
}
local casbin = require("casbin")
function CustomHandler:access(conf)
local enforcer = casbin:new(conf.model_path, conf.policy_path)
enforcer:enableLogs(conf.debug)
-- [...]
end
return CustomHandler
The text was updated successfully, but these errors were encountered:
@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 🙂
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:
The text was updated successfully, but these errors were encountered: