ashb commented on code in PR #48491:
URL: https://github.com/apache/airflow/pull/48491#discussion_r2022259155


##########
task-sdk/src/airflow/sdk/log.py:
##########
@@ -472,25 +486,17 @@ def init_log_file(local_relative_path: str) -> Path:
     return full_path
 
 
-def load_remote_log_handler() -> logging.Handler | None:
-    from airflow.logging_config import configure_logging as 
airflow_configure_logging
-    from airflow.utils.log.log_reader import TaskLogReader
+def load_remote_log_handler() -> RemoteLogIO | None:
+    import airflow.logging_config
 
-    try:
-        airflow_configure_logging()
-
-        return TaskLogReader().log_handler
-    finally:
-        # This is a _monstrosity_ but put our logging back immediately...
-        configure_logging()
+    return airflow.logging_config.REMOTE_TASK_LOG
 
 
 def upload_to_remote(logger: FilteringBoundLogger):
     # We haven't yet switched the Remote log handlers over, they are still 
wired up in providers as
     # logging.Handlers (but we should re-write most of them to just be the 
upload and read instead of full
     # variants.) In the mean time, lets just create the right handler directly

Review Comment:
   No good catch!



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