You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/08/20 23:00:00 UTC
[GitHub] [airflow] mik-laj edited a comment on issue #9036: Task instance log_filepath doesn't include try_number
mik-laj edited a comment on issue #9036:
URL: https://github.com/apache/airflow/issues/9036#issuecomment-677945797
> so it is showing the wrong path in emails and I would like to try and fix it and submit a PR.
In my opinion, there is no universal method for determining the correct path to a file as there are TaskHandler which do not use files. For example: The StackdriverTaskHandler uses the ``"task_id"``, ``"dag_id"``,`` "execution_date"``, ``"try_number"`` labels which are added to each log entry.
I think, we should abandon the use of file paths. Third-party services can access the log using the stable API.
https://airflow.readthedocs.io/en/latest/stable-rest-api-ref.html#operation/get_log
You may try to use FileTaskHandler, but this is problematic and will not be compatible with all handlers.
```python
from logging
logging._handlers('task')._render_filename(ti, try_number).
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org