core.config.logconfig_utils =========================== .. py:module:: core.config.logconfig_utils .. autoapi-nested-parse:: Utilities for loading and overriding logging configurations. This module provides functions to load template-based logconfigs and apply user-specified overrides from JobmonConfig. Functions --------- .. autoapisummary:: core.config.logconfig_utils.merge_logconfig_sections core.config.logconfig_utils.load_logconfig_with_overrides core.config.logconfig_utils.configure_logging_with_overrides core.config.logconfig_utils.get_logconfig_examples core.config.logconfig_utils.configure_component_logging core.config.logconfig_utils._get_component_template_path Module Contents --------------- .. py:function:: merge_logconfig_sections(base_config: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, Any] Merge logconfig section overrides into base configuration. This performs a deep merge, allowing users to override specific formatters, handlers, or loggers while preserving the rest of the base configuration. :param base_config: Base logconfig dictionary (from templates) :param overrides: Override sections from JobmonConfig :returns: Merged logconfig dictionary .. py:function:: load_logconfig_with_overrides(default_template_path: str, config_section: str, config: Optional[jobmon.core.configuration.JobmonConfig] = None) -> Dict[str, Any] Load logconfig with support for user overrides from JobmonConfig. Supports two types of overrides: 1. File-based: Custom logconfig file specified in logging.{component}_logconfig_file 2. Section-based: Override specific sections specified in logging.{component}.* :param default_template_path: Path to the default template-based logconfig :param config_section: Config section name ('client', 'server', 'requester') :param config: JobmonConfig instance (creates default if None) :returns: Fully resolved logconfig dictionary ready for logging.config.dictConfig() .. py:function:: configure_logging_with_overrides(default_template_path: str, config_section: str, fallback_config: Optional[Dict[str, Any]] = None, config: Optional[jobmon.core.configuration.JobmonConfig] = None) -> None Configure logging with template and override support. This is a convenience function that loads a logconfig with overrides and applies it using logging.config.dictConfig(). :param default_template_path: Path to the default template-based logconfig :param config_section: Config section name ('client', 'server', 'requester') :param fallback_config: Fallback config if template loading fails :param config: JobmonConfig instance (creates default if None) .. py:function:: get_logconfig_examples() -> Dict[str, Dict[str, Any]] Get example configurations for documentation and testing. :returns: Dictionary of example logconfig override configurations by component .. py:function:: configure_component_logging(component_name: str) -> None Configure logging for jobmon components using existing override system. This function integrates seamlessly with the existing logging infrastructure and follows the same patterns as configure_client_logging(). Configuration precedence (handled by existing load_logconfig_with_overrides): 1. File override: logging.{component}_logconfig_file 2. Template: logconfig_{component}.yaml 3. Section override: logging.{component}.* 4. No logging: if no configuration found :param component_name: Component name ('distributor', 'worker', 'server') .. py:function:: _get_component_template_path(component_name: str) -> str Get the template path for a component following local package pattern. :param component_name: Component name ('distributor', 'worker', 'server') :returns: Path to component's local logconfig template, or empty string if not found