ianbuss commented on issue #47634: URL: https://github.com/apache/airflow/issues/47634#issuecomment-2715493105
While identifying the solution I applied the following "hack" in https://github.com/astronomer/airflow/blob/eebdf4e9fbbe9badd1f93dbaf1c9a0d1d2aa357c/task-sdk/src/airflow/sdk/log.py ``` diff --git i/task-sdk/src/airflow/sdk/log.py w/task-sdk/src/airflow/sdk/log.py index 3da1d1e1f7..0eb938e4fc 100644 --- i/task-sdk/src/airflow/sdk/log.py +++ w/task-sdk/src/airflow/sdk/log.py @@ -481,6 +481,9 @@ def upload_to_remote(logger: FilteringBoundLogger): base_log_folder = conf.get("logging", "base_log_folder") relative_path = Path(fname).relative_to(base_log_folder) + from airflow.logging_config import configure_logging + configure_logging() + handler = TaskLogReader().log_handler if not isinstance(handler, FileTaskHandler): logger.warning( @@ -493,7 +496,9 @@ def upload_to_remote(logger: FilteringBoundLogger): # set_context() which opens a real FH again. (And worse, in some cases it _truncates_ the file too). This # is just for the first Airflow 3 betas, but we will re-write a better remote log interface that isn't # tied to being a logging Handler. + handler.log_meta_dict = {} handler.log_relative_path = relative_path.as_posix() # type: ignore[attr-defined] handler.upload_on_close = True # type: ignore[attr-defined] handler.close() ``` -- 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]
