SZL741023 commented on code in PR #67104:
URL: https://github.com/apache/airflow/pull/67104#discussion_r3588950934
##########
airflow-core/src/airflow/logging_config.py:
##########
@@ -120,6 +120,44 @@ def load_logging_config() -> tuple[dict[str, Any], str]:
) or DEFAULT_LOGGING_CONFIG_PATH
+def _warn_if_missing_remote_task_log(logging_class_path: str) -> None:
+ """
+ Warn if ``[logging] remote_logging`` is on but the user module exposes no
remote IO.
+
+ Runs *after* ``dictConfig`` has constructed handlers, so deprecated
+ self-registration in provider task handlers (Elasticsearch, OpenSearch) has
+ already had its chance to populate
``_ActiveLoggingConfig.remote_task_log``.
+ Only fires for user-defined ``logging_config_class`` values; the stock
+ fallback is exempt.
+
+ :param logging_class_path: the resolved ``[logging] logging_config_class``
+ dotted path (already defaulted to :data:`DEFAULT_LOGGING_CONFIG_PATH`).
+ """
+ # An empty path is not a meaningful override -- ``_get_logging_config()``
treats it the
+ # same as unset and falls back to ``DEFAULT_LOGGING_CONFIG_PATH``, so it
must not be
+ # treated as a user-defined logging config class here either.
+ has_user_defined_logging_config_class = (
+ bool(logging_class_path) and logging_class_path !=
DEFAULT_LOGGING_CONFIG_PATH
+ )
+ remote_logging_enabled = conf.getboolean("logging", "remote_logging",
fallback=False)
+ if not (has_user_defined_logging_config_class and remote_logging_enabled):
+ return
+ if _ActiveLoggingConfig.remote_task_log is not None:
Review Comment:
```suggestion
if get_remote_task_log():
```
I think this condition statement may be replaced by `if
get_remote_task_log()`.
This seems to be the way to actually obtain the remote task log to determine
if there is a miss log issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]