GitHub user ConanLord edited a comment on the discussion: Remote logging and 
SSH tunnel

I found a way by patching the function `FileTaskHandler._get_log_retrieval_url` 
in `webserver_config.py` :

```
from airflow.utils.log.file_task_handler import FileTaskHandler, LogType
from urllib.parse import urljoin
from airflow.configuration import conf

def custom_get_log_retrieval_url(...) -> tuple[str, str]:
    (...)
    if hostname == 'MWorker':
        print('>>>>>> file_task_handler._get_log_retrieval_url : changing 
hostname',hostname,' to 127.0.0.1')
        hostname = '127.0.0.1'
    return (
        urljoin(...
    (...)

FileTaskHandler._get_log_retrieval_url = custom_get_log_retrieval_url
```

This is quite dirty ... Is there a cleaner way to do this ?

GitHub link: 
https://github.com/apache/airflow/discussions/49343#discussioncomment-12855002

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

Reply via email to