apache / apache/airflow

Deprecate task log prefix

Open
#39,019 14 comments 0 reactions 0 assignees View on GitHub
area:core kind:task
Dominant language
Python
Stars
46.9k
Forks
17.8k
Avg merge
2d 7h
Merged PRs (30d)
484

Description

### Apache Airflow version

2.9.0

### What happened?

There is a part of code that may have been dead since airflow 2.0.0 for task logs prefix. The code is extending a StreamHandler which is not being used anywhere. The current local or remote task logs are extending FileTaskHandler.

### What you think should happen instead?

Either this should be completely removed from Airflow or fix the feature with FileTaskHandler

### How to reproduce

Set `AIRFLOW__LOGGING__TASK_LOG_PREFIX_TEMPLATE` with an example provided in the [docs](https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#task-log-prefix-template).

### Operating System

Any

### Versions of Apache Airflow Providers

Not Applicable.

### Deployment

Docker-Compose

### Deployment details

_No response_

### Anything else?

I have raised a PR #38709 in an attempt to make this feature working with FileTaskHandler.
Though I understand there might not be any point in bring a dead feature back.
So, I'm proposing to remove the config `task_log_prefix_template` all together residing in below code:
https://github.com/apache/airflow/blob/f8104325b7a66d4e98ff3a6c3555f90c796071c6/airflow/utils/log/task_handler_with_custom_formatter.py#L36

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

Contributor guide

Open the contributing guide

Research direction

Start with airflow/utils/log/task_handler_with_custom_formatter.py and the task_log_prefix_template configuration described in the issue and linked documentation. Review the discussion and PR #38709 to determine whether the intended outcome is removal or support through FileTaskHandler; done means the chosen behavior, configuration, and documentation are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.