structlog_config.env_config#

Configure custom logger behavior based on environment variables.

Attributes#

Classes#

EnvLoggerConfig

Level and path for one logger, taken from LOG_LEVEL_* and LOG_PATH_*.

Functions#

get_custom_logger_config() → dict[str, EnvLoggerConfig]

Parse environment variables to extract custom logger configurations.

Module Contents#

structlog_config.env_config.LOG_LEVEL_PATTERN[source]#
structlog_config.env_config.LOG_PATH_PATTERN[source]#
class structlog_config.env_config.EnvLoggerConfig[source]#

Bases: TypedDict

Level and path for one logger, taken from LOG_LEVEL_* and LOG_PATH_*.

level: NotRequired[str][source]#
path: NotRequired[str][source]#
structlog_config.env_config.get_custom_logger_config() → dict[str, EnvLoggerConfig][source]#

Parse environment variables to extract custom logger configurations.

Logger names in the variable use underscores instead of dots. LOG_LEVEL_HTTPX and LOG_PATH_HTTPX configure the httpx logger.

Returns:

Mapping of logger name to level and path settings.