ashb commented on a change in pull request #9363:
URL: https://github.com/apache/airflow/pull/9363#discussion_r444519387
##########
File path: airflow/cli/commands/task_command.py
##########
@@ -182,9 +184,25 @@ def task_run(args, dag=None):
if args.interactive:
_run_task_by_selected_method(args, dag, ti)
else:
+ airflow_logger = None
+ airflow_logger_handlers = []
+ if CAN_FORK:
+ airflow_logger_handlers =
logging.getLogger('airflow.task').handlers
+ airflow_logger = logging.getLogger('airflow')
+ for handler in airflow_logger_handlers:
+ airflow_logger.addHandler(handler)
+ airflow_logger.setLevel(logging.getLogger('airflow.task').level)
+ airflow_logger.propagate = False
Review comment:
Is this the best place to put this? Could it perhaps instead be put in
StandardTaskRUnner._start_by_fork?
This all feels a little odd and out of place here. At the very least this
needs loads of explanatory comments!
What does this change do if someone runs `airflow task run` directly?
----------------------------------------------------------------
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:
[email protected]