]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr: route the root-logger fallback through a module-independent sink
authorKefu Chai <k.chai@proxmox.com>
Wed, 24 Jun 2026 06:03:06 +0000 (14:03 +0800)
committerKefu Chai <k.chai@proxmox.com>
Mon, 13 Jul 2026 02:12:04 +0000 (10:12 +0800)
commit3705db897484743849dd9ec417a7aa94f4e0f77b
treec7896b4c0c3007b346db499b1ec3ec6c8f29c6c7
parent9e656e9655b0e866f806042866cd2006225d8220
mgr: route the root-logger fallback through a module-independent sink

MgrRootHandler captures third-party logs from the Python root logger
and emits them through the _ceph_log method of whichever mgr module
last configured logging.  A handler on the root logger outlives any
single module, so once that module unloads the handler emits through
a stale pointer until another module reconfigures logging.

Add a free mgr_log() function to the ceph_module binding, emitting
via dout() like PyModuleRunner::log but with no PyModule involved,
and rewrite MgrRootHandler to route through it.  The handler no
longer references a module instance, so it cannot go stale.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/mgr/PyModule.cc
src/pybind/mgr/ceph_module.pyi
src/pybind/mgr/mgr_module.py