Skip to content

Clarify logging_config_class contract and document REMOTE_TASK_LOG#67104

Open
jason810496 wants to merge 5 commits into
apache:mainfrom
jason810496:refactor/logging/clarify-logging-config-class-core
Open

Clarify logging_config_class contract and document REMOTE_TASK_LOG#67104
jason810496 wants to merge 5 commits into
apache:mainfrom
jason810496:refactor/logging/clarify-logging-config-class-core

Conversation

@jason810496

@jason810496 jason810496 commented May 18, 2026

Copy link
Copy Markdown
Member

Why

[logging] logging_config_class is documented as a "Logging class" but actually resolves to a logging.config.dictConfig dict, and the REMOTE_TASK_LOG / DEFAULT_REMOTE_CONN_ID side channel that powers remote log read-back was undocumented.

So custom configs silently lost UI log read-back, and ElasticsearchTaskHandler / OpensearchTaskHandler papered over it by self-registering from inside __init__. The provider-side deprecation of that self-registration is split into follow-up PRs (one for elasticsearch, one for opensearch); this PR is the core/SDK/shared-library piece they depend on.

How

  • Document the real contract for logging_config_class (dict, not class) and the REMOTE_TASK_LOG / DEFAULT_REMOTE_CONN_ID module-level attributes in the config option help, advanced-logging-configuration.rst, and the discover_remote_log_handler docstring.
  • Add a startup WARNING for the case that "user module is missing REMOTE_TASK_LOG while remote_logging is on". The warning is emitted from configure_logging after dictConfig runs, so the check sees the final state — important because the deprecated ES/OS self-registration path populates _ActiveLoggingConfig.remote_task_log from inside the handler __init__.
  • Drop the remote_logging_enabled parameter from discover_remote_log_handler (no longer needed now that the warning lives in configure_logging).
  • Add unit tests for _warn_if_missing_remote_task_log.

Was generative AI tooling used to co-author this PR?

@amoghrajesh

Copy link
Copy Markdown
Contributor

@jason810496 I wanna take a look at this one but do not have b/w atm, will do soon

@eladkal

eladkal commented May 20, 2026

Copy link
Copy Markdown
Contributor

I think we will need to bump

"elasticsearch": parse_version("6.5.0"),
"opensearch": parse_version("1.9.0"),

as part of this PR but we will need to wait for providers to be released

@eladkal eladkal added this to the Airflow 3.3.0 milestone May 23, 2026
@eladkal

eladkal commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

@jason810496 can you fix the problem above?

Comment thread airflow-core/src/airflow/config_templates/config.yml Outdated
@jason810496 jason810496 marked this pull request as draft June 5, 2026 14:22
@jason810496 jason810496 force-pushed the refactor/logging/clarify-logging-config-class-core branch 3 times, most recently from 584e906 to eef5d24 Compare June 5, 2026 14:43
@jason810496 jason810496 marked this pull request as ready for review June 5, 2026 14:44

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review Elad, Phani. I addressed both comments in last rebase.

@jason810496 jason810496 marked this pull request as draft June 9, 2026 02:22
@jason810496 jason810496 force-pushed the refactor/logging/clarify-logging-config-class-core branch from eef5d24 to 654cbec Compare June 9, 2026 02:48

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eladkal,
I some help to resolve the static check CI failure when you have a moment. Thanks.

If I don't update the root pyproject.toml I will encounter:

Update Airflow's meta-package pyproject.toml............................................................Failed
  - hook id: update-pyproject-toml
  - files were modified by this hook

All changes made by hooks:
diff --git a/pyproject.toml b/pyproject.toml
index bae4c06..5a6f250 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -219,7 +219,7 @@ apache-airflow = "airflow.__main__:main"
     "apache-airflow-providers-edge3>=1.0.0"
 ]
 "elasticsearch" = [
-    "apache-airflow-providers-elasticsearch>=6.5.0" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
+    "apache-airflow-providers-elasticsearch>=6.6.0" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
 ]
 "exasol" = [
     "apache-airflow-providers-exasol>=4.6.1"
@@ -306,7 +306,7 @@ apache-airflow = "airflow.__main__:main"
     "apache-airflow-providers-openlineage>=2.3.0" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
 ]
 "opensearch" = [
-    "apache-airflow-providers-opensearch>=1.9.0" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
+    "apache-airflow-providers-opensearch>=1.9.3" # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
 ]
 "opsgenie" = [
     "apache-airflow-providers-opsgenie>=5.8.0"
@@ -447,7 +447,7 @@ apache-airflow = "airflow.__main__:main"
     "apache-airflow-providers-discord>=3.9.0",
     "apache-airflow-providers-docker>=3.14.1",
     "apache-airflow-providers-edge3>=1.0.0",
-    "apache-airflow-providers-elasticsearch>=6.5.0", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
+    "apache-airflow-providers-elasticsearch>=6.6.0", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
     "apache-airflow-providers-exasol>=4.6.1",
     "apache-airflow-providers-fab>=3.6.0", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
     "apache-airflow-providers-facebook>=3.7.0",
@@ -476,7 +476,7 @@ apache-airflow = "airflow.__main__:main"
     "apache-airflow-providers-openai>=1.5.0",
     "apache-airflow-providers-openfaas>=3.7.0",
     "apache-airflow-providers-openlineage>=2.3.0", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
-    "apache-airflow-providers-opensearch>=1.9.0", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
+    "apache-airflow-providers-opensearch>=1.9.3", # Set from MIN_VERSION_OVERRIDE in update_airflow_pyproject_toml.py
     "apache-airflow-providers-opsgenie>=5.8.0",
     "apache-airflow-providers-oracle>=3.12.0",
     "apache-airflow-providers-pagerduty>=3.8.1",

Fail run: https://github.com/apache/airflow/actions/runs/27183757151/job/80249517727

However, if I update the pyproject.toml. I will encounter the following error from breeze ci selective-check for the CI Image check:

Provider dependency version bumps detected that should only be performed by Release Managers!

  - pyproject.toml : apache-airflow-providers-elasticsearch >= version changed from 6.5.0 to 6.6.0
  - pyproject.toml : apache-airflow-providers-opensearch >= version changed from 1.9.0 to 1.9.3
  - pyproject.toml : apache-airflow-providers-elasticsearch >= version changed from 6.5.0 to 6.6.0
  - pyproject.toml : apache-airflow-providers-opensearch >= version changed from 1.9.0 to 1.9.3

Fail run: https://github.com/apache/airflow/actions/runs/27185728163/job/80254150717

@eladkal

eladkal commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

I think you just need to add allow provider dependency bump label and rebase the PR. That will make breeze ci selective-check pass.
I assume release manager @vatsrahul1001 is OK with this

@jason810496 jason810496 force-pushed the refactor/logging/clarify-logging-config-class-core branch from 7a6c3f2 to 9849cf9 Compare June 10, 2026 01:54
@eladkal

eladkal commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@jason810496 CI seems to be green. I guess the PR is ready for review?

@jason810496 jason810496 marked this pull request as ready for review June 11, 2026 01:40
@jason810496

Copy link
Copy Markdown
Member Author

@jason810496 CI seems to be green. I guess the PR is ready for review?

Yes, it's ready for review now. Thanks for the reminder.

@ashb

ashb commented Jun 11, 2026

Copy link
Copy Markdown
Member

I'm fairly sure that the logging.config.dictConfig from the file is not 99% ignored?

``[logging] logging_config_class`` is documented as a "Logging class" but
actually resolves to a ``logging.config.dictConfig`` dict, and the
``REMOTE_TASK_LOG`` / ``DEFAULT_REMOTE_CONN_ID`` side channel that powers
remote log read-back was undocumented. Custom configs silently lost UI log
read-back as a result.

- Document the real contract for ``logging_config_class`` (dict, not class)
  and the ``REMOTE_TASK_LOG`` / ``DEFAULT_REMOTE_CONN_ID`` module-level
  attributes in the config option help, ``advanced-logging-configuration.rst``,
  and the ``discover_remote_log_handler`` docstring.
- Add a startup ``WARNING`` when ``remote_logging`` is on but the user's
  logging module is missing ``REMOTE_TASK_LOG``, emitted from
  ``configure_logging`` after ``dictConfig`` runs so it sees the final state.
Document only REMOTE_TASK_LOG / DEFAULT_REMOTE_CONN_ID in the new remote logging section; do not show users a LOGGING_CONFIG dict to build.
@jason810496 jason810496 force-pushed the refactor/logging/clarify-logging-config-class-core branch from 9849cf9 to b5b681b Compare June 19, 2026 04:38
@jason810496 jason810496 requested a review from ashb June 22, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

5 participants