Skip to content

Decouple remote logging config from core - #67056

Merged
jscheffl merged 7 commits into
apache:mainfrom
jason810496:refactor/logging/decuple-logging-config-from-core
Jun 4, 2026
Merged

Decouple remote logging config from core#67056
jscheffl merged 7 commits into
apache:mainfrom
jason810496:refactor/logging/decuple-logging-config-from-core

Conversation

@jason810496

@jason810496jason810496 commented May 17, 2026

Copy link
Copy Markdown
Member

Why

Decouple remote logging config from hardcoded airflow-core/src/airflow/config_templates/airflow_local_settings.py by introducing new remote-logging field for ProvidersManager. Add shared resolve_remote_task_log it, so core and the Task SDK
share one implementation of the precedence rule.

What

Single shared resolver resolve_remote_task_log with an explicit three-tier precedence:

  1. User-defined [logging] logging_config_class module exporting
    REMOTE_TASK_LOG / DEFAULT_REMOTE_CONN_ID.
  2. ProvidersManager scheme dispatch on [logging] remote_base_log_folder,
    instantiated via the provider class's from_config() classmethod.
  3. Legacy attr-path fallback against
    airflow.config_templates.airflow_local_settings (transitional).

airflow.logging_config.load_logging_config is deprecated and split into

  • _get_logging_config() (logging dict)
  • _load_logging_config() (remote handler, lazy)
  • configure_logging no longer eagerly resolves the remote handler.

Next step to deprecate hardcoded airflow_local_settings.py

  1. Provider migration: Migrate the logic from airflow_local_settings.py as from_config method for each current supported RemoteIO.
classS3RemoteLogIO(LoggingMixin):
@classmethoddeffrom_config(cls) ->"S3RemoteLogIO":
fromairflow.providers.common.compat.sdkimportconf# provider-specific `conf` validation or custom logicreturncls(
base_log_folder=conf.get("logging", "base_log_folder"),
remote_base=conf.get("logging", "remote_base_log_folder"),
delete_local_copy=conf.getboolean("logging", "delete_local_logs"),
)
  1. Raise deprecation warning for each if/else branch after the corresponding RemoteIO.from_config is added.

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

Comment threadairflow-core/newsfragments/67056.significant.rst Outdated
Comment threadairflow-core/src/airflow/providers_manager.py Outdated

@jscheffljscheffl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks clean and good to me - except some small comments. Another pair of eyes would be good prior merge.

…config
Decouple importing the [logging] logging_config_class dict from
remote-handler resolution so each can run independently. The deprecated
load_logging_config wrapper delegates to both and keeps the old return
shape. Wire the lazy remote-handler load through the shared
resolve_remote_task_log factory.
@jason810496
jason810496force-pushed the refactor/logging/decuple-logging-config-from-core branch from aa513bb to 37939dcCompareMay 19, 2026 04:32
@jason810496jason810496 added this to the Airflow 3.3.0 milestone May 25, 2026

@eladkaleladkal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM
but need a 2nd reviewer to check it as well

@jscheffljscheffl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As I was first reviewer, I think LGTM

@jscheffl
jscheffl merged commit ab1418f into apache:mainJun 4, 2026
143 checks passed
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 13, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the
cloudwatch scheme.
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 13, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the s3
scheme as the first adopter.
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 13, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the
cloudwatch scheme.
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 13, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the s3
scheme as the first adopter.
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 18, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the s3
scheme as the first adopter.
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 18, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the
cloudwatch scheme.
jason810496 added a commit that referenced this pull request Jul 22, 2026
…69816)
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since #67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the
cloudwatch scheme.
jason810496 added a commit to jason810496/airflow that referenced this pull request Jul 22, 2026
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since apache#67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the s3
scheme as the first adopter.
jason810496 added a commit that referenced this pull request Jul 22, 2026
…69817)
Airflow resolves remote task log handlers through provider dispatch on
the remote_base_log_folder URL scheme since #67056; providers must
expose from_config so core and the Task SDK no longer depend on the
hardcoded branches in airflow_local_settings.py. This migrates the s3
scheme as the first adopter.
potiuk pushed a commit to Andrushika/airflow that referenced this pull request Aug 1, 2026
Core resolves remote log handlers by URL scheme through ProvidersManager dispatch (apache#67056); s3 and cloudwatch already migrated. This moves wasb onto the same path, so Azure Blob remote logging is built by the provider's from_config() instead of the hardcoded branch in airflow_local_settings.py. Existing wasb:// configs resolve to an equivalent handler, and a from_config failure falls back to the legacy path, so behaviour is unchanged.
Part of apache#70265. closesapache#70268.
potiuk pushed a commit that referenced this pull request Aug 1, 2026
…me (#70301)
Core resolves remote log handlers by URL scheme through ProvidersManager dispatch (#67056); s3 and cloudwatch already migrated. This moves wasb onto the same path, so Azure Blob remote logging is built by the provider's from_config() instead of the hardcoded branch in airflow_local_settings.py. Existing wasb:// configs resolve to an equivalent handler, and a from_config failure falls back to the legacy path, so behaviour is unchanged.
Part of #70265. closes#70268.
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
…me (apache#70301)
Core resolves remote log handlers by URL scheme through ProvidersManager dispatch (apache#67056); s3 and cloudwatch already migrated. This moves wasb onto the same path, so Azure Blob remote logging is built by the provider's from_config() instead of the hardcoded branch in airflow_local_settings.py. Existing wasb:// configs resolve to an equivalent handler, and a from_config failure falls back to the legacy path, so behaviour is unchanged.
Part of apache#70265. closesapache#70268.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jason810496@eladkal@jscheffl