File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -151,8 +151,6 @@ def configure_enforcer_auto_save_and_load(cls):
151151
152152 if auto_load_policy_interval > 0 :
153153 cls .configure_enforcer_auto_loading (auto_load_policy_interval )
154- else :
155- logger .warning ("CASBIN_AUTO_LOAD_POLICY_INTERVAL is not set or zero; auto-load is disabled." )
156154
157155 cls .configure_enforcer_auto_save (auto_save_policy )
158156
@@ -248,9 +246,10 @@ def _initialize_enforcer(cls) -> SyncedEnforcer:
248246 # Avoid circular import
249247 from openedx_authz .engine .matcher import is_admin_or_superuser_check # pylint: disable=import-outside-toplevel
250248
251- # Silence verbose casbin policy logging BEFORE creating the enforcer
252- # to prevent print_policy() from showing during initialization
249+ # Configure logging BEFORE initialize_enforcer() because it creates a ProxyEnforcer
250+ # that doesn't pass logging config and would use Casbin's defaults
253251 logging .getLogger ("casbin.policy" ).setLevel (logging .WARNING )
252+ logging .getLogger ("casbin.role" ).setLevel (logging .WARNING )
254253
255254 db_alias = getattr (settings , "CASBIN_DB_ALIAS" , "default" )
256255
You can’t perform that action at this time.
0 commit comments