diff --git a/airflow/configuration.py b/airflow/configuration.py index f4bea46c5c0ba..4238d59054cf3 100644 --- a/airflow/configuration.py +++ b/airflow/configuration.py @@ -327,36 +327,12 @@ def sensitive_config_values(self) -> Set[tuple[str, str]]: # noqa: UP006 # DeprecationWarning will be issued and the old option will be used instead deprecated_options: dict[tuple[str, str], tuple[str, str, str]] = { ("celery", "worker_precheck"): ("core", "worker_precheck", "2.0.0"), - ("logging", "interleave_timestamp_parser"): ("core", "interleave_timestamp_parser", "2.6.1"), - ("logging", "base_log_folder"): ("core", "base_log_folder", "2.0.0"), - ("logging", "remote_logging"): ("core", "remote_logging", "2.0.0"), - ("logging", "remote_log_conn_id"): ("core", "remote_log_conn_id", "2.0.0"), - ("logging", "remote_base_log_folder"): ("core", "remote_base_log_folder", "2.0.0"), - ("logging", "encrypt_s3_logs"): ("core", "encrypt_s3_logs", "2.0.0"), - ("logging", "logging_level"): ("core", "logging_level", "2.0.0"), - ("logging", "fab_logging_level"): ("core", "fab_logging_level", "2.0.0"), - ("logging", "logging_config_class"): ("core", "logging_config_class", "2.0.0"), - ("logging", "colored_console_log"): ("core", "colored_console_log", "2.0.0"), - ("logging", "colored_log_format"): ("core", "colored_log_format", "2.0.0"), - ("logging", "colored_formatter_class"): ("core", "colored_formatter_class", "2.0.0"), - ("logging", "log_format"): ("core", "log_format", "2.0.0"), - ("logging", "simple_log_format"): ("core", "simple_log_format", "2.0.0"), - ("logging", "task_log_prefix_template"): ("core", "task_log_prefix_template", "2.0.0"), - ("logging", "log_filename_template"): ("core", "log_filename_template", "2.0.0"), - ("logging", "log_processor_filename_template"): ("core", "log_processor_filename_template", "2.0.0"), - ("logging", "dag_processor_manager_log_location"): ( - "core", - "dag_processor_manager_log_location", - "2.0.0", - ), - ("logging", "task_log_reader"): ("core", "task_log_reader", "2.0.0"), ("scheduler", "parsing_processes"): ("scheduler", "max_threads", "1.10.14"), ("operators", "default_queue"): ("celery", "default_queue", "2.1.0"), ("core", "hide_sensitive_var_conn_fields"): ("admin", "hide_sensitive_variable_fields", "2.1.0"), ("core", "sensitive_var_conn_names"): ("admin", "sensitive_variable_fields", "2.1.0"), ("core", "default_pool_task_slot_count"): ("core", "non_pooled_task_slot_count", "1.10.4"), ("core", "max_active_tasks_per_dag"): ("core", "dag_concurrency", "2.2.0"), - ("logging", "worker_log_server_port"): ("celery", "worker_log_server_port", "2.2.0"), ("api", "access_control_allow_origins"): ("api", "access_control_allow_origin", "2.2.0"), ("api", "auth_backends"): ("api", "auth_backend", "2.3.0"), ("database", "sql_alchemy_conn"): ("core", "sql_alchemy_conn", "2.3.0"), diff --git a/newsfragments/42100.significant.rst b/newsfragments/42100.significant.rst new file mode 100644 index 0000000000000..c256d575a01bf --- /dev/null +++ b/newsfragments/42100.significant.rst @@ -0,0 +1,21 @@ +Removed deprecated logging configuration. + + * Removed deprecated configuration ``interleave_timestamp_parser`` from ``core``. Please use ``interleave_timestamp_parser`` from ``logging`` instead. + * Removed deprecated configuration ``base_log_folder`` from ``core``. Please use ``base_log_folder`` from ``logging`` instead. + * Removed deprecated configuration ``remote_logging`` from ``core``. Please use ``remote_logging`` from ``logging`` instead. + * Removed deprecated configuration ``remote_log_conn_id`` from ``core``. Please use ``remote_log_conn_id`` from ``logging`` instead. + * Removed deprecated configuration ``remote_base_log_folder`` from ``core``. Please use ``remote_base_log_folder`` from ``logging`` instead. + * Removed deprecated configuration ``encrypt_s3_logs`` from ``core``. Please use ``encrypt_s3_logs`` from ``logging`` instead. + * Removed deprecated configuration ``logging_level`` from ``core``. Please use ``logging_level`` from ``logging`` instead. + * Removed deprecated configuration ``fab_logging_level`` from ``core``. Please use ``fab_logging_level`` from ``logging`` instead. + * Removed deprecated configuration ``logging_config_class`` from ``core``. Please use ``logging_config_class`` from ``logging`` instead. + * Removed deprecated configuration ``colored_console_log`` from ``core``. Please use ``colored_console_log`` from ``logging`` instead. + * Removed deprecated configuration ``colored_log_format`` from ``core``. Please use ``colored_log_format`` from ``logging`` instead. + * Removed deprecated configuration ``colored_formatter_class`` from ``core``. Please use ``colored_formatter_class`` from ``logging`` instead. + * Removed deprecated configuration ``log_format`` from ``core``. Please use ``log_format`` from ``logging`` instead. + * Removed deprecated configuration ``simple_log_format`` from ``core``. Please use ``simple_log_format`` from ``logging`` instead. + * Removed deprecated configuration ``task_log_prefix_template`` from ``core``. Please use ``task_log_prefix_template`` from ``logging`` instead. + * Removed deprecated configuration ``log_filename_template`` from ``core``. Please use ``log_filename_template`` from ``logging`` instead. + * Removed deprecated configuration ``log_processor_filename_template`` from ``core``. Please use ``log_processor_filename_template`` from ``logging`` instead. + * Removed deprecated configuration ``dag_processor_manager_log_location`` from ``core``. Please use ``dag_processor_manager_log_location`` from ``logging`` instead. + * Removed deprecated configuration ``task_log_reader`` from ``core``. Please use ``task_log_reader`` from ``logging`` instead. diff --git a/tests/core/test_configuration.py b/tests/core/test_configuration.py index d02e9b4b3cb82..af43daa303df8 100644 --- a/tests/core/test_configuration.py +++ b/tests/core/test_configuration.py @@ -956,33 +956,6 @@ def test_deprecated_options(self): with pytest.warns(DeprecationWarning), conf_vars({("celery", "celeryd_concurrency"): "99"}): assert conf.getint("celery", "worker_concurrency") == 99 - @conf_vars( - { - ("logging", "logging_level"): None, - ("core", "logging_level"): None, - } - ) - def test_deprecated_options_with_new_section(self): - # Guarantee we have a deprecated setting, so we test the deprecation - # lookup even if we remove this explicit fallback - with set_deprecated_options( - deprecated_options={("logging", "logging_level"): ("core", "logging_level", "2.0.0")} - ): - # Remove it so we are sure we use the right setting - conf.remove_option("core", "logging_level") - conf.remove_option("logging", "logging_level") - - with pytest.warns(DeprecationWarning): - with mock.patch.dict("os.environ", AIRFLOW__CORE__LOGGING_LEVEL="VALUE"): - assert conf.get("logging", "logging_level") == "VALUE" - - with pytest.warns(FutureWarning, match="Please update your `conf.get"): - with mock.patch.dict("os.environ", AIRFLOW__CORE__LOGGING_LEVEL="VALUE"): - assert conf.get("core", "logging_level") == "VALUE" - - with pytest.warns(DeprecationWarning), conf_vars({("core", "logging_level"): "VALUE"}): - assert conf.get("logging", "logging_level") == "VALUE" - @conf_vars( { ("celery", "result_backend"): None,