title: No logs from Airflow tasks running in BashOperator
body: <p>After upgrading form Airflow 2.1.3 to 2.2.0 I’m missing some basic logs from BashOperator.</p>
  <ul>
  <li>Airflow Version: 2.2.0</li>
  <li>Python version: 3.7.10</li>
  <li>OS: Amazon Linux 4.14.252-195.483.amzn2.x86_64</li>
  </ul>
  <p>Here’s a test Dag that should fail:</p>
  <pre><code>dag = DAG('darren_test', default_args = default_args, schedule_interval = '* * * * *')
  
  templated_command = &quot;&quot;&quot;
      ech &quot;This task should fail {{ execution_date }}&quot;
  &quot;&quot;&quot;
  
  darren_test_task = BashOperator(
      task_id = 'darren_test_task',
      bash_command = templated_command,
      dag = dag)
  </code></pre>
  <p>Logs from Airflow 2.1.3</p>
  <pre><code>*** Reading local file: /data/logs/airflow/darren_test/darren_test_task/2021-10-27T00:01:00+00:00/1.log
  [2021-11-22 12:37:32,014] {{taskinstance.py:1035}} INFO - Dependencies all met for &lt;TaskInstance: darren_test.darren_test_task scheduled__2021-10-27T00:01:00+00:00 [queued]&gt;
  [2021-11-22 12:37:32,030] {{taskinstance.py:1035}} INFO - Dependencies all met for &lt;TaskInstance: darren_test.darren_test_task scheduled__2021-10-27T00:01:00+00:00 [queued]&gt;
  [2021-11-22 12:37:32,030] {{taskinstance.py:1241}} INFO - 
  --------------------------------------------------------------------------------
  [2021-11-22 12:37:32,030] {{taskinstance.py:1242}} INFO - Starting attempt 1 of 1
  [2021-11-22 12:37:32,030] {{taskinstance.py:1243}} INFO - 
  --------------------------------------------------------------------------------
  [2021-11-22 12:37:32,062] {{taskinstance.py:1262}} INFO - Executing &lt;Task(BashOperator): darren_test_task&gt; on 2021-10-27 00:01:00+00:00
  [2021-11-22 12:37:32,064] {{base_task_runner.py:141}} INFO - Running on host: dst1.darren.######.local
  [2021-11-22 12:37:32,064] {{base_task_runner.py:142}} INFO - Running: ['airflow', 'tasks', 'run', 'darren_test', 'darren_test_task', 'scheduled__2021-10-27T00:01:00+00:00', '--job-id', '40', '--raw', '--subdir', 'DAGS_FOLDER/darren_test.py', '--cfg-path', '/tmp/tmpp954_9bo', '--error-file', '/tmp/tmpp_no352f']
  [2021-11-22 12:37:35,330] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task [[34m2021-11-22 12:37:35,329[0m] {{[34mdagbag.py:[0m500}} INFO[0m - Filling up the DagBag from /data/R_Scripts/dags/darren_test.py[0m
  [2021-11-22 12:37:37,103] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task Running &lt;TaskInstance: darren_test.darren_test_task scheduled__2021-10-27T00:01:00+00:00 [running]&gt; on host dst1.darren.######.local
  [2021-11-22 12:37:37,132] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task Traceback (most recent call last):
  [2021-11-22 12:37:37,132] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task   File &quot;/usr/local/bin/airflow&quot;, line 8, in &lt;module&gt;
  [2021-11-22 12:37:37,132] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task     sys.exit(main())
  [2021-11-22 12:37:37,132] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/__main__.py&quot;, line 40, in main
  [2021-11-22 12:37:37,132] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task     args.func(args)
  [2021-11-22 12:37:37,132] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/cli_parser.py&quot;, line 48, in command
  [2021-11-22 12:37:37,133] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task     return func(*args, **kwargs)
  ...
  [2021-11-22 12:37:37,135] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/operators/bash.py&quot;, line 188, in execute
  [2021-11-22 12:37:37,135] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task     f'Bash command failed. The command returned a non-zero exit code {result.exit_code}.'
  [2021-11-22 12:37:37,135] {{base_task_runner.py:126}} INFO - Job 40: Subtask darren_test_task airflow.exceptions.AirflowException: Bash command failed. The command returned a non-zero exit code 127.
  [2021-11-22 12:37:37,167] {{local_task_job.py:212}} WARNING - State of this instance has been externally set to failed. Terminating instance.
  [2021-11-22 12:37:37,171] {{process_utils.py:100}} INFO - Sending Signals.SIGTERM to GPID 21664
  [2021-11-22 12:37:37,177] {{process_utils.py:66}} INFO - Process psutil.Process(pid=21664, status='terminated', exitcode=&lt;Negsignal.SIGTERM: -15&gt;, started='12:37:31') (21664) terminated with exit code Negsignal.SIGTERM
  [2021-11-22 17:49:35,681] {{taskinstance.py:903}} INFO - Dependencies all met for &lt;TaskInstance: darren_test.darren_test_task 2021-10-27T00:01:00+00:00 [queued]&gt;
  [2021-11-22 17:49:35,697] {{taskinstance.py:903}} INFO - Dependencies all met for &lt;TaskInstance: darren_test.darren_test_task 2021-10-27T00:01:00+00:00 [queued]&gt;
  [2021-11-22 17:49:35,697] {{taskinstance.py:1094}} INFO - 
  --------------------------------------------------------------------------------
  [2021-11-22 17:49:35,697] {{taskinstance.py:1095}} INFO - Starting attempt 1 of 1
  [2021-11-22 17:49:35,697] {{taskinstance.py:1096}} INFO - 
  --------------------------------------------------------------------------------
  [2021-11-22 17:49:35,712] {{taskinstance.py:1114}} INFO - Executing &lt;Task(BashOperator): darren_test_task&gt; on 2021-10-27T00:01:00+00:00
  [2021-11-22 17:49:35,713] {{base_task_runner.py:133}} INFO - Running on host: dst1.darren.######.local
  [2021-11-22 17:49:35,713] {{base_task_runner.py:134}} INFO - Running: ['airflow', 'tasks', 'run', 'darren_test', 'darren_test_task', '2021-10-27T00:01:00+00:00', '--job-id', '6', '--pool', 'default_pool', '--raw', '--subdir', 'DAGS_FOLDER/darren_test.py', '--cfg-path', '/tmp/tmp9gcomh3z', '--error-file', '/tmp/tmpfy1j62e2']
  [2021-11-22 17:49:37,329] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task [[34m2021-11-22 17:49:37,328[0m] {{[34mdagbag.py:[0m496}} INFO[0m - Filling up the DagBag from /data/R_Scripts/dags/darren_test.py
  [2021-11-22 17:49:37,768] {{subprocess.py:52}} INFO - Tmp dir root location:
  [2021-11-22 17:49:37,769] {{subprocess.py:63}} INFO - Running command: ['bash', '-c', '\n    ech &quot;This task should fail 2021-10-27T00:01:00+00:00&quot;']
  [2021-11-22 17:49:37,780] {{subprocess.py:74}} INFO - Output:
  [2021-11-22 17:49:37,793] {{subprocess.py:78}} INFO - bash: line 1: ech: command not found
  [2021-11-22 17:49:37,794] {{subprocess.py:82}} INFO - Command exited with return code 127
  [2021-11-22 17:49:37,829] {{taskinstance.py:1462}} ERROR - Task failed with exception
  Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1164, in _run_raw_task
      self._prepare_and_execute_task_with_callbacks(context, task)
    File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1282, in _prepare_and_execute_task_with_callbacks
      result = self._execute_task(context, task_copy)
    File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1312, in _execute_task
      result = task_copy.execute(context=context)
    File &quot;/usr/local/lib/python3.7/site-packages/airflow/operators/bash.py&quot;, line 176, in execute
      raise AirflowException('Bash command failed. The command returned a non-zero exit code.')
  airflow.exceptions.AirflowException: Bash command failed. The command returned a non-zero exit code.
  [2021-11-22 17:49:37,833] {{taskinstance.py:1512}} INFO - Marking task as FAILED. dag_id=darren_test, task_id=darren_test_task, execution_date=20211027T000100, start_date=20211122T174935, end_date=20211122T174937
  [2021-11-22 17:49:37,885] {{logging_mixin.py:109}} WARNING - /usr/local/lib/python3.7/site-packages/airflow/utils/email.py:102 PendingDeprecationWarning: Fetching SMTP credentials from configuration variables will be deprecated in a future release. Please set credentials using a connection instead.
  [2021-11-22 17:49:37,885] {{email.py:208}} INFO - Email alerting: attempt 1
  [2021-11-22 17:49:38,508] {{email.py:220}} INFO - Sent an alert email to ['darren@#####.com']
  [2021-11-22 17:49:38,885] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task Running &lt;TaskInstance: darren_test.darren_test_task 2021-10-27T00:01:00+00:00 [running]&gt; on host dst1.darren.######.local
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task Traceback (most recent call last):
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/bin/airflow&quot;, line 8, in &lt;module&gt;
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     sys.exit(main())
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/__main__.py&quot;, line 40, in main
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     args.func(args)
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/cli_parser.py&quot;, line 48, in command
  [2021-11-22 17:49:38,890] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     return func(*args, **kwargs)
  [2021-11-22 17:49:38,891] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/utils/cli.py&quot;, line 91, in wrapper
  [2021-11-22 17:49:38,891] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     return f(*args, **kwargs)
  [2021-11-22 17:49:38,891] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/commands/task_command.py&quot;, line 238, in task_run
  [2021-11-22 17:49:38,891] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     _run_task_by_selected_method(args, dag, ti)
  [2021-11-22 17:49:38,891] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/commands/task_command.py&quot;, line 66, in _run_task_by_selected_method
  [2021-11-22 17:49:38,891] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     _run_raw_task(args, ti)
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/commands/task_command.py&quot;, line 153, in _run_raw_task
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     error_file=args.error_file,
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/utils/session.py&quot;, line 70, in wrapper
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     return func(*args, session=session, **kwargs)
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1164, in _run_raw_task
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     self._prepare_and_execute_task_with_callbacks(context, task)
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1282, in _prepare_and_execute_task_with_callbacks
  [2021-11-22 17:49:38,892] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     result = self._execute_task(context, task_copy)
  [2021-11-22 17:49:38,893] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1312, in _execute_task
  [2021-11-22 17:49:38,893] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     result = task_copy.execute(context=context)
  [2021-11-22 17:49:38,893] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/operators/bash.py&quot;, line 176, in execute
  [2021-11-22 17:49:38,893] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task     raise AirflowException('Bash command failed. The command returned a non-zero exit code.')
  [2021-11-22 17:49:38,893] {{base_task_runner.py:118}} INFO - Job 6: Subtask darren_test_task airflow.exceptions.AirflowException: Bash command failed. The command returned a non-zero exit code.
  [2021-11-22 17:49:39,072] {{local_task_job.py:151}} INFO - Task exited with return code 1
  </code></pre>
  <p>There are 2 important pieces on information logged here</p>
  <ol>
  <li><p>The command that was run:</p>
  <pre><code>`Running: ['airflow', 'tasks', 'run', 'darren_test', 'darren_test_task', ...
  </code></pre>
  </li>
  <li><p>The stderr from the bash task is displayed: <code>INFO - bash: line 1: ech: command not found</code></p>
  </li>
  </ol>
  <p>Logs from Airflow 2.2.0:</p>
  <pre><code>*** Reading local file: /data/logs/airflow/darren_test/darren_test_task/2021-10-27T00:05:00+00:00/1.log
  [2021-11-22, 13:38:14 ] {{taskinstance.py:1035}} INFO - Dependencies all met for &lt;TaskInstance: darren_test.darren_test_task scheduled__2021-10-27T00:05:00+00:00 [queued]&gt;
  [2021-11-22, 13:38:14 ] {{taskinstance.py:1035}} INFO - Dependencies all met for &lt;TaskInstance: darren_test.darren_test_task scheduled__2021-10-27T00:05:00+00:00 [queued]&gt;
  [2021-11-22, 13:38:14 ] {{taskinstance.py:1241}} INFO - 
  --------------------------------------------------------------------------------
  [2021-11-22, 13:38:14 ] {{taskinstance.py:1242}} INFO - Starting attempt 1 of 1
  [2021-11-22, 13:38:14 ] {{taskinstance.py:1243}} INFO - 
  --------------------------------------------------------------------------------
  [2021-11-22, 13:38:14 ] {{taskinstance.py:1262}} INFO - Executing &lt;Task(BashOperator): darren_test_task&gt; on 2021-10-27 00:05:00+00:00
  [2021-11-22, 13:38:14 ] {{base_task_runner.py:141}} INFO - Running on host: dst1.darren.######.local
  [2021-11-22, 13:38:14 ] {{base_task_runner.py:142}} INFO - Running: ['airflow', 'tasks', 'run', 'darren_test', 'darren_test_task', 'scheduled__2021-10-27T00:05:00+00:00', '--job-id', '46', '--raw', '--subdir', 'DAGS_FOLDER/darren_test.py', '--cfg-path', '/tmp/tmp1a0wtk4o', '--error-file', '/tmp/tmpmz8211qn']
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task [[34m2021-11-22, 13:38:19 [0m] {{[34mdagbag.py:[0m500}} INFO[0m - Filling up the DagBag from /data/R_Scripts/dags/darren_test.py[0m
  [2021-11-22, 13:38:19 ] {{local_task_job.py:207}} WARNING - Recorded pid 22016 does not match the current pid 22036
  [2021-11-22, 13:38:19 ] {{process_utils.py:100}} INFO - Sending Signals.SIGTERM to GPID 22036
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task Running &lt;TaskInstance: darren_test.darren_test_task scheduled__2021-10-27T00:05:00+00:00 [running]&gt; on host dst1.darren.######.local
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task Traceback (most recent call last):
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/bin/airflow&quot;, line 8, in &lt;module&gt;
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     sys.exit(main())
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/__main__.py&quot;, line 40, in main
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     args.func(args)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/cli_parser.py&quot;, line 48, in command
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     return func(*args, **kwargs)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/utils/cli.py&quot;, line 92, in wrapper
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     return f(*args, **kwargs)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/commands/task_command.py&quot;, line 292, in task_run
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     _run_task_by_selected_method(args, dag, ti)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/commands/task_command.py&quot;, line 107, in _run_task_by_selected_method
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     _run_raw_task(args, ti)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/cli/commands/task_command.py&quot;, line 184, in _run_raw_task
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     error_file=args.error_file,
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/utils/session.py&quot;, line 70, in wrapper
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     return func(*args, session=session, **kwargs)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1324, in _run_raw_task
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     self._execute_task_with_callbacks(context)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1443, in _execute_task_with_callbacks
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     result = self._execute_task(context, self.task)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/models/taskinstance.py&quot;, line 1499, in _execute_task
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     result = execute_callable(context=context)
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task   File &quot;/usr/local/lib/python3.7/site-packages/airflow/operators/bash.py&quot;, line 188, in execute
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task     f'Bash command failed. The command returned a non-zero exit code {result.exit_code}.'
  [2021-11-22, 13:38:19 ] {{base_task_runner.py:126}} INFO - Job 46: Subtask darren_test_task airflow.exceptions.AirflowException: Bash command failed. The command returned a non-zero exit code 127.
  [2021-11-22, 13:38:20 ] {{process_utils.py:66}} INFO - Process psutil.Process(pid=22036, status='terminated', exitcode=1, started='12:38:14') (22036) terminated with exit code 1
  </code></pre>
  <p>The 2 important pieces of information that we had in v2.1.3 are gone.
  No Running...” to show the bash command and for the error it just says <code>Bash command failed</code> without the actual stderr.
  In this simple case it’s not so much of an issue, but for complex DAGs with multiple dependant tasks it becomes impossible to troubleshoot any issues.</p>
  <p>This is the logging configuration which is the same for both Airflow versions tested</p>
  <pre><code>[logging]
  base_log_folder = /data/logs/airflow
  remote_logging = False
  remote_log_conn_id =
  google_key_path =
  remote_base_log_folder =
  encrypt_s3_logs = False
  logging_level = INFO
  fab_logging_level = INFO
  logging_config_class = custom_logging_config.DEFAULT_LOGGING_CONFIG
  colored_console_log = True
  colored_log_format = [%(blue)s%(asctime)s%(reset)s] {{%(blue)s%(filename)s:%(reset)s%(lineno)d}} %(log_color)s%(levelname)s%(reset)s - %(log_color)s%(message)s%(reset)s
  colored_formatter_class = airflow.utils.log.colored_log.CustomTTYColoredFormatter
  log_format = [%(asctime)s] {{%(filename)s:%(lineno)d}} %(levelname)s - %(message)s
  simple_log_format = %(asctime)s %(levelname)s - %(message)s
  task_log_prefix_template =
  log_filename_template = {{ ti.dag_id }}/{{ ti.task_id }}/{{ ts }}/{{ try_number }}.log
  log_processor_filename_template = {{ filename }}.log
  dag_processor_manager_log_location = /data/logs/airflow/dag_processor_manager/dag_processor_manager.log
  task_log_reader = task
  extra_loggers =
  extra_logger_names =
  worker_log_server_port = 8793
  </code></pre>
  <p>And this is the logging_config_class which is also the same for both Airflow versions tested</p>
  <pre><code>&quot;&quot;&quot;Airflow logging settings&quot;&quot;&quot;
  
  import os
  from pathlib import Path
  from typing import Any, Dict, Union
  from urllib.parse import urlparse
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException
  
  # TODO: Logging format and level should be configured
  # in this file instead of from airflow.cfg. Currently
  # there are other log format and level configurations in
  # settings.py and cli.py. Please see AIRFLOW-1455.
  LOG_LEVEL: str = conf.get('logging', 'LOGGING_LEVEL').upper()
  
  
  # Flask appbuilder's info level log is very verbose,
  # so it's set to 'WARN' by default.
  FAB_LOG_LEVEL: str = conf.get('logging', 'FAB_LOGGING_LEVEL').upper()
  LOG_FORMAT: str = conf.get('logging', 'LOG_FORMAT')
  COLORED_LOG_FORMAT: str = conf.get('logging', 'COLORED_LOG_FORMAT')
  COLORED_LOG: bool = conf.getboolean('logging', 'COLORED_CONSOLE_LOG')
  COLORED_FORMATTER_CLASS: str = conf.get('logging', 'COLORED_FORMATTER_CLASS')
  BASE_LOG_FOLDER: str = conf.get('logging', 'BASE_LOG_FOLDER')
  PROCESSOR_LOG_FOLDER: str = conf.get('scheduler', 'CHILD_PROCESS_LOG_DIRECTORY')
  DAG_PROCESSOR_MANAGER_LOG_LOCATION: str = conf.get('logging', 'DAG_PROCESSOR_MANAGER_LOG_LOCATION')
  FILENAME_TEMPLATE: str = conf.get('logging', 'LOG_FILENAME_TEMPLATE')
  PROCESSOR_FILENAME_TEMPLATE: str = conf.get('logging', 'LOG_PROCESSOR_FILENAME_TEMPLATE')
  DEFAULT_LOGGING_CONFIG: Dict[str, Any] = {
  'version': 1,
  'disable_existing_loggers': False,
  'formatters': {
      'airflow': {'format': LOG_FORMAT},
      'airflow_coloured': {
          'format': COLORED_LOG_FORMAT if COLORED_LOG else LOG_FORMAT,
          'class': COLORED_FORMATTER_CLASS if COLORED_LOG else 'logging.Formatter',
      },
  },
  'filters': {
      'mask_secrets': {
          '()': 'airflow.utils.log.secrets_masker.SecretsMasker',
      },
  },
  'handlers': {
      'console': {
          'class': 'airflow.utils.log.logging_mixin.RedirectStdHandler',
          'formatter': 'airflow_coloured',
          'stream': 'sys.stdout',
          'filters': ['mask_secrets'],
      },
      'task': {
          'class': 'airflow.utils.log.file_task_handler.FileTaskHandler',
          'formatter': 'airflow',
          'base_log_folder': os.path.expanduser(BASE_LOG_FOLDER),
          'filename_template': FILENAME_TEMPLATE,
          'filters': ['mask_secrets'],
      },
      'processor': {
          'class': 'airflow.utils.log.file_processor_handler.FileProcessorHandler',
          'formatter': 'airflow',
          'base_log_folder': os.path.expanduser(PROCESSOR_LOG_FOLDER),
          'filename_template': PROCESSOR_FILENAME_TEMPLATE,
          'filters': ['mask_secrets'],
      },
  },
  'loggers': {
      'airflow.processor': {
          'handlers': ['processor'],
          'level': LOG_LEVEL,
          'propagate': False,
      },
      'airflow.task': {
          'handlers': ['task'],
          'level': LOG_LEVEL,
          'propagate': False,
          'filters': ['mask_secrets'],
      },
      'flask_appbuilder': {
          'handlers': ['console'],
          'level': FAB_LOG_LEVEL,
          'propagate': True,
      },
  },
  'root': {
      'handlers': ['console'],
      'level': LOG_LEVEL,
      'filters': ['mask_secrets'],
  },
  }
  
  EXTRA_LOGGER_NAMES: str = conf.get('logging', 'EXTRA_LOGGER_NAMES', fallback=None)
  if EXTRA_LOGGER_NAMES:
  new_loggers = {
      logger_name.strip(): {
          'handlers': ['console'],
          'level': LOG_LEVEL,
          'propagate': True,
      }
      for logger_name in EXTRA_LOGGER_NAMES.split(&quot;,&quot;)
  }
  DEFAULT_LOGGING_CONFIG['loggers'].update(new_loggers)
  
  DEFAULT_DAG_PARSING_LOGGING_CONFIG: Dict[str, Dict[str, Dict[str, Any]]] = {
  'handlers': {
      'processor_manager': {
          'class': 'logging.handlers.RotatingFileHandler',
          'formatter': 'airflow',
          'filename': DAG_PROCESSOR_MANAGER_LOG_LOCATION,
          'mode': 'a',
          'maxBytes': 104857600,  # 100MB
          'backupCount': 5,
      }
  },
  'loggers': {
      'airflow.processor_manager': {
          'handlers': ['processor_manager'],
          'level': LOG_LEVEL,
          'propagate': False,
      }
  },
  }
  
  # Only update the handlers and loggers when CONFIG_PROCESSOR_MANAGER_LOGGER is set.
  # This is to avoid exceptions when initializing RotatingFileHandler multiple times
  # in multiple processes.
  if os.environ.get('CONFIG_PROCESSOR_MANAGER_LOGGER') == 'True':
  DEFAULT_LOGGING_CONFIG['handlers'].update(DEFAULT_DAG_PARSING_LOGGING_CONFIG['handlers'])
  DEFAULT_LOGGING_CONFIG['loggers'].update(DEFAULT_DAG_PARSING_LOGGING_CONFIG['loggers'])
  
  # Manually create log directory for processor_manager handler as RotatingFileHandler
  # will only create file but not the directory.
  processor_manager_handler_config: Dict[str, Any] = DEFAULT_DAG_PARSING_LOGGING_CONFIG['handlers'][
      'processor_manager'
  ]
  directory: str = os.path.dirname(processor_manager_handler_config['filename'])
  Path(directory).mkdir(parents=True, exist_ok=True, mode=0o755)
  
  ##################
  # Remote logging #
  ##################
  
  # All of this section is commented as we don't use it for now.
  </code></pre>
  <p>If someone could point me in the right direction I'd really appreciate it.
  Thank you.</p>
  <p><strong>Update:</strong> in comparing the logs I noticed that Airflow 2.2.0 doesn't have any of the logs from <code>{{ subprocess.py }}</code>. Does anyone know why that is? Is it related with my custom log config class maybe? Thanks!</p>