python_structlog_config.config ============================== .. py:module:: python_structlog_config.config .. autoapi-nested-parse:: Core structlog configuration. Extracted from GridFlow backend/src/infrastructure/logging_config.py Enhanced with OTel and Sentry support per PRD specifications Functions --------- .. autoapisummary:: python_structlog_config.config.configure_structlog python_structlog_config.config.get_logger Module Contents --------------- .. py:function:: configure_structlog(log_level: str = 'INFO', json_output: bool = False, enable_otel: bool = False, enable_sentry: bool = False, sentry_dsn: Optional[str] = None, service_name: Optional[str] = None, environment: Optional[str] = None) -> None Configure structlog with optional OTel and Sentry integration. Args: log_level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) json_output: Use JSON renderer instead of console (default: False) enable_otel: Enable OpenTelemetry integration (default: False) enable_sentry: Enable Sentry integration (default: False) sentry_dsn: Sentry DSN (required if enable_sentry=True) service_name: Service name for context (optional) environment: Environment name (dev, staging, prod) Example: >>> configure_structlog( ... log_level="INFO", ... json_output=True, ... service_name="my-api" ... ) .. py:function:: get_logger(name: Optional[str] = None) Get a structlog logger instance. Args: name: Logger name (optional) Returns: Structlog logger instance Example: >>> logger = get_logger(__name__) >>> logger.info("Application started")