jscheffl commented on code in PR #67056:
URL: https://github.com/apache/airflow/pull/67056#discussion_r3261275066


##########
airflow-core/src/airflow/providers_manager.py:
##########
@@ -1240,6 +1256,32 @@ def _discover_logging(self) -> None:
                     if _correctness_check(provider_package, 
logging_class_name, provider):
                         self._logging_class_name_set.add(logging_class_name)
 
+    def _discover_remote_logging(self) -> None:
+        """Retrieve all remote logging IO handlers defined in the providers."""
+        for provider_package, provider in self._provider_dict.items():
+            entries = provider.data.get("remote-logging") or []
+            for entry in entries:
+                classpath = entry["classpath"]
+                if not _correctness_check(provider_package, classpath, 
provider):
+                    continue
+                info = RemoteLoggingInfo(
+                    classpath=classpath,
+                    scheme=entry["scheme"],
+                    package_name=provider_package,
+                )
+                self._remote_logging_info_list.append(info)
+                existing = self._remote_logging_by_scheme.get(info.scheme)
+                if existing is not None:
+                    log.warning(
+                        "Remote logging scheme '%s' is already registered by 
%s; ignoring "
+                        "duplicate registration from %s.",
+                        info.scheme,
+                        existing.package_name,
+                        info.package_name,
+                    )
+                    continue
+                self._remote_logging_by_scheme[info.scheme] = info

Review Comment:
   Pessimistic, I think if we ignore on duplicate scheme we should also only 
add it to list if check passed
   ```suggestion
                   existing = self._remote_logging_by_scheme.get(info.scheme)
                   if existing is not None:
                       log.warning(
                           "Remote logging scheme '%s' is already registered by 
%s; ignoring "
                           "duplicate registration from %s.",
                           info.scheme,
                           existing.package_name,
                           info.package_name,
                       )
                       continue
                   self._remote_logging_info_list.append(info)
                   self._remote_logging_by_scheme[info.scheme] = info
   ```



-- 
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]

Reply via email to