You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/12/05 19:24:00 UTC
[jira] [Commented] (AIRFLOW-1876) Subtask logs are not easily
distinguised
[ https://issues.apache.org/jira/browse/AIRFLOW-1876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16279080#comment-16279080 ]
ASF subversion and git services commented on AIRFLOW-1876:
----------------------------------------------------------
Commit a9ceca5e04d3bdfbd34adc4ef5bf95c5cbf5c954 in incubator-airflow's branch refs/heads/master from [~wrp]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=a9ceca5 ]
[AIRFLOW-1876] Write subtask id to task log header
Closes #2835 from wrp/subtask-id
> Subtask logs are not easily distinguised
> ----------------------------------------
>
> Key: AIRFLOW-1876
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1876
> Project: Apache Airflow
> Issue Type: Improvement
> Components: core
> Reporter: William Pursell
> Assignee: William Pursell
> Priority: Minor
> Fix For: 1.10.0
>
> Original Estimate: 0.25h
> Remaining Estimate: 0.25h
>
> Currently, when the scheduler is outputting all subtask logs to the same stream, it is not easy to distinguish which logs come from which task. It would be nice if there were some convenient way to filter the logs from a given task. For example, putting the task id after the word 'Subtask'
> For example:
> diff --git a/airflow/task_runner/base_task_runner.py b/airflow/task_runner/base_task_runner.py
> index bc0edcf3..e40f6ea9 100644
> --- a/airflow/task_runner/base_task_runner.py
> +++ b/airflow/task_runner/base_task_runner.py
> @@ -95,7 +95,11 @@ class BaseTaskRunner(LoggingMixin):
> line = line.decode('utf-8')
> if len(line) == 0:
> break
> - self.log.info(u'Subtask %s: %s', self._task_instance, line.rstrip('\n'))
> + self.log.info(
> + u'Subtask %d: %s',
> + self._task_instance.job_id,
> + line.rstrip('\n')
> + )
>
> def run_command(self, run_with, join_args=False):
> """
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)