configure_pylog_MDC¶
- lsst.log.configure_pylog_MDC(level: str, MDC_class: type | None = <class 'lsst.log.log.logContinued.MDCDict'>)¶
- Configure log4cxx to send messages to Python logging, with MDC support. - Parameters:
- levelstr
- Name of the logging level for root log4cxx logger. 
- MDC_classtype, optional
- Type of dictionary which is added to - logging.LogRecordas an- MDCattribute. Any dictionary or- defaultdict-like class can be used as a type. If- Nonethe- logging.LogRecordwill not be augmented.
 
- level
 - Notes - This method does two things: - Configures log4cxx with a given logging level and a - PyLogAppenderappender class which forwards all messages to Python- logging.
- Installs a record factory for Python - loggingthat adds- MDCattribute to every- logging.LogRecordobject (instance of- MDC_class). This will happen by default but can be disabled by setting the- MDC_classparameter to- None.