diff --git a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py index d1471052a9f..f0d5ddba5f3 100644 --- a/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py +++ b/services/dynamic-scheduler/src/simcore_service_dynamic_scheduler/core/settings.py @@ -1,6 +1,6 @@ import datetime -from pydantic import AliasChoices, Field, TypeAdapter, field_validator +from pydantic import AliasChoices, ConfigDict, Field, TypeAdapter, field_validator from servicelib.logging_utils_filtering import LoggerName, MessageSubstring from settings_library.application import BaseApplicationSettings from settings_library.basic_types import LogLevel, VersionTag @@ -32,19 +32,27 @@ class _BaseApplicationSettings(BaseApplicationSettings, MixinLoggingSettings): DYNAMIC_SCHEDULER_LOG_FORMAT_LOCAL_DEV_ENABLED: bool = Field( default=False, validation_alias=AliasChoices( - "DYNAMIC_SCHEDULER_LOG_FORMAT_LOCAL_DEV_ENABLED", "LOG_FORMAT_LOCAL_DEV_ENABLED", + "DYNAMIC_SCHEDULER_LOG_FORMAT_LOCAL_DEV_ENABLED", + ), + description=( + "Enables local development log format. WARNING: make sure it " + "is disabled if you want to have structured logs!" ), - description="Enables local development log format. WARNING: make sure it is disabled if you want to have structured logs!", ) DYNAMIC_SCHEDULER_LOG_FILTER_MAPPING: dict[ LoggerName, list[MessageSubstring] ] = Field( default_factory=dict, validation_alias=AliasChoices( - "DYNAMIC_SCHEDULER_LOG_FILTER_MAPPING", "LOG_FILTER_MAPPING" + "LOG_FILTER_MAPPING", + "DYNAMIC_SCHEDULER_LOG_FILTER_MAPPING", + ), + description=( + "is a dictionary that maps specific loggers " + "(such as 'uvicorn.access' or 'gunicorn.access') to a list " + "of log message patterns that should be filtered out." ), - description="is a dictionary that maps specific loggers (such as 'uvicorn.access' or 'gunicorn.access') to a list of log message patterns that should be filtered out.", ) DYNAMIC_SCHEDULER_STOP_SERVICE_TIMEOUT: datetime.timedelta = Field( @@ -60,6 +68,8 @@ class _BaseApplicationSettings(BaseApplicationSettings, MixinLoggingSettings): def _validate_log_level(cls, value: str) -> str: return cls.validate_log_level(value) + model_config = ConfigDict(extra="allow") + class ApplicationSettings(_BaseApplicationSettings): """Web app's environment variables