GitHub user julienlagorsse-loreal edited a comment on the discussion: 
ElasticSearch Logs not working

We have the same bug, connection seems to be fine in webserver as we get 200 on 
some count request however we get this in webserver log page
*** Log 
debug_airflow_to_es-print_debug_message-manual__2024-12-06T12:23:30.109158+00:00--1-1
 not found in Elasticsearch. If your task started recently, please wait a 
moment and reload this page. Otherwise, the logs for this task instance may 
have been removed.

When I check on elasticsearch there is no index.

The triggerer seems to create a wrapper to redirect to stdout to elasticsearch, 
we don't really understand the NOTSET part

2024-12-06 13:26:10 [2024-12-06T12:26:10.912+0000] 
{triggerer_job_runner.py:181} INFO - Setting up TriggererHandlerWrapper with 
handler <ElasticsearchTaskHandler (NOTSET)>
2024-12-06 13:26:10 [2024-12-06T12:26:10.914+0000] 
{triggerer_job_runner.py:237} INFO - Setting up logging queue listener with 
handlers [<RedirectStdHandler <stdout> (NOTSET)>, <TriggererHandlerWrapper 
(NOTSET)>]
2024-12-06 13:26:10 [2024-12-06T12:26:10.920+0000] 
{triggerer_job_runner.py:338} INFO - Starting the triggerer

We don't really use this triggerer for now so it doesn't help much

We can see Listening at: http://[::]:8794  for triggerer

For Worker we don't see a wrapper logs, but we see the listening 
http://[::]:8793
but nothing else seems to be really related to logging.

We aren't really if it's the responsibility of the worker to push logs on 
elasticsearch, and we don't know who is responsible to write logs.

Elasticsearch is hosted in a docker compose, same network, curl 
elasticsearch:9200 works everywhere (worker, webserver, ...)


AIRFLOW_CONN_ELASTICSEARCH_DEFAULT: "http://elasticsearch:9200";
_PIP_ADDITIONAL_REQUIREMENTS: 
${_PIP_ADDITIONAL_REQUIREMENTS:-apache-airflow-providers-elasticsearch}


[logging]
logging_level = INFO
remote_logging = True
remote_log_conn_id=elasticsearch_default
[elasticsearch]
host = http://elasticsearch:9200
write_stdout = True
json_format = True
[elasticsearch_configs]
verify_certs=False

GitHub link: 
https://github.com/apache/airflow/discussions/23734#discussioncomment-11484605

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to