Fix: Restore live stdout logging for Elasticsearch in Airflow 3#64067
Fix: Restore live stdout logging for Elasticsearch in Airflow 3#64067eladkal merged 1 commit intoapache:mainfrom
Conversation
|
cc @Owen-CH-Leung for review as the expert :) |
|
@Subham-KRLX can you share screenshots from elastic confirming this works? |
@eladkal I am currently in a remote environment and can't provide a live Kibana dashboard screenshot however can I share the actual JSON stdout logs and the passing unit test results from a local run? this will confirm that the ElasticsearchTaskHandler is correctly restored in the configuration and is emitting logs to stdout as intended. |
{ The test suite also confirms the core fix with 60 passing tests: providers/elasticsearch/tests/unit/elasticsearch/log/test_es_task_handler.py [100%] This ensures that ElasticsearchTaskHandler is once again respected in the logging configuration template resolving the regression where stdout logs were no longer visible. |
|
LGTM. Thanks! |
|
Hi @Subham-KRLX, I just wanted to double check that this PR will fully address the issue of logs not showing up in container stdout when using LocalExecutor, which is what I was trying to fix via: #63960. This is a Claude summary of what was tried locally: |
|
@taranlu-houzz You are absolutely right about the LocalExecutor log forwarding I am updating this PR to pass subprocess_logs_to_stdout=True to the supervisor in LocalExecutor which will ensure task logs are correctly forwarded to the container's stdout in Airflow 3. |
eeedc54 to
8af1b77
Compare
…tor log forwarding in Airflow 3 This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. closes: apache#63960 closes: apache#49863 closes: apache#54501
8af1b77 to
0df2f6d
Compare
…rwarding (#64067) This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. (cherry picked from commit f1495c2) Co-authored-by: Subham <subhamsangwan26@gmail.com> closes: #63960 closes: #49863 closes: #54501
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…rwarding (apache#64067) This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. (cherry picked from commit f1495c2) Co-authored-by: Subham <subhamsangwan26@gmail.com> closes: apache#63960 closes: apache#49863 closes: apache#54501
…rwarding (#64067) (#64592) This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. (cherry picked from commit f1495c2) closes: #63960 closes: #49863 closes: #54501 Co-authored-by: Subham <subhamsangwan26@gmail.com> Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
…ache#64067) This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. closes: apache#63960 closes: apache#49863 closes: apache#54501
…ache#64067) This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. closes: apache#63960 closes: apache#49863 closes: apache#54501
…rwarding (#64067) (#64592) This restores the ElasticsearchTaskHandler in airflow_local_settings.py and ensures LocalExecutor forwards task logs to stdout by passing subprocess_logs_to_stdout=True to the supervisor. (cherry picked from commit f1495c2) closes: #63960 closes: #49863 closes: #54501 Co-authored-by: Subham <subhamsangwan26@gmail.com> Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
This PR restores the ElasticsearchTaskHandler in DEFAULT_LOGGING_CONFIG within airflow_local_settings.py, resolving the regression where task logs were no longer visible in stdout after upgrading to Airflow 3.While ElasticsearchRemoteLogIO
was previously added for remote retrieval, the handler itself was omitted from the configuration block. This caused Airflow to fall back to the generic FileTaskHandler, which does not support the write_stdout configuration. Restoring the handler ensures that logs are correctly sent to stdout(for Fluentd/container log shippers) when configured.
This aligns the Elasticsearch provider's logging configuration with the patterns used by Opensearch and Stackdriver.
closes: #63960
closes: #49863
closes: #54501
Was generative AI tooling used to co-author this PR?
Yes — Gemini (Code Research and PR Description)