mgr: forward the root-logger fallback at the record's own level
ceph_module.mgr_log() emitted every record at dout(0): a record either passed the Python-side gate and went unconditionally to both the log file and the in-memory recent buffer, or never reached the C++ log at all. The two-level debug_mgr semantics (file level / memory level) never applied, so capturing third-party DEBUG logs meant sending each record to the log file and a log_max_recent slot; with the kubernetes client logging multi-megabyte HTTP response bodies at DEBUG, the recent buffer alone could grow to tens of gigabytes. Pass the record's level through mgr_log() and emit at the mapped ceph level: CRITICAL/ERROR at 0, WARNING at 1, INFO at 2, DEBUG at 20. INFO maps to 2 so it stays visible in the log file at the default debug_mgr=2/5; DEBUG maps to 20 so floods are dropped there, while debug_mgr=2/20 captures third-party DEBUG in the in-memory buffer without touching the log file. The Python-side gate follows the higher of the two debug_mgr levels so memory-only records still reach the C++ side. Fixes: https://tracker.ceph.com/issues/77633 Signed-off-by: Kefu Chai <k.chai@proxmox.com>
K
Kefu Chai committed
e61de15ddb8502abcd74c01617e0c8416bd77bd1
Parent: 3705db8