Fix: Restore live stdout logging for Elasticsearch in Airflow 3#64067
Fix: Restore live stdout logging for Elasticsearch in Airflow 3#64067Subham-KRLX wants to merge 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. |
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)