<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">Other Airflow 2 version (please specify below)</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">I am running airflow 2.4.2 in EKS 1.22 with minor tweaks to official helm chart. I am observing in UI, in task logs each log line is coming twice. Attaching a screen-shot below of the issue. As visible here all log lines are repeated twice in task log file.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/95409716/203499788-5e6dd417-1a25-46e0-aa5a-73c0d56bdc3b.png"><img width="1736" alt="Screenshot 2022-11-23 at 1 51 39 PM" src="https://user-images.githubusercontent.com/95409716/203499788-5e6dd417-1a25-46e0-aa5a-73c0d56bdc3b.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">Each log line should be coming once in task logs, this is important as task logs will take twice the space as required.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Should be able to reproduce by running any dag on airflow 2.4.2 with official helm chart on EKS v1.22 and observing task logs.</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)” NAME=“Debian GNU/Linux” VERSION_ID=“11” VERSION=“11 (bullseye)” VERSION_CODENAME=bullseye ID=debian</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Official Apache Airflow Helm Chart</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Anything else</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>
<h3 dir="auto">Apache Airflow version</h3>
<p dir="auto">2.4.2</p>
<h3 dir="auto">What happened</h3>
<p dir="auto">We upgraded airflow from 2.4.1 to 2.4.2 and immediately notice that every task log line is duplicated <em>into</em> CloudWatch. Comparing logs from tasks run before upgrade and after upgrade indicates that the issue is not in how the logs are displayed in Airflow, but rather that it now produces two log lines instead of one.</p>
<p dir="auto">When observing both the CloudWatch log streams and the Airflow UI, we can see duplicate log lines for <del><em>all</em></del> most log entries post upgrade, whilst seeing single log lines in tasks before upgrade.</p>
<p dir="auto">This happens <em>both</em> for tasks ran in a remote <code class="notranslate">EcsRunTaskOperator</code>'s as well as in regular <code class="notranslate">PythonOperator</code>'s.</p>
<h3 dir="auto">What you think should happen instead</h3>
<p dir="auto">A single non-duplicate log line should be produced into CloudWatch.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">From my understanding now, any setup on 2.4.2 that uses CloudWatch remote logging will produce duplicate log lines. (But I have not been able to confirm other setups)</p>
<h3 dir="auto">Operating System</h3>
<p dir="auto">Docker: <code class="notranslate">apache/airflow:2.4.2-python3.9</code> - Running on AWS ECS Fargate</p>
<h3 dir="auto">Versions of Apache Airflow Providers</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="apache-airflow[celery,postgres,apache.hive,jdbc,mysql,ssh,amazon,google,google_auth]==2.4.2
apache-airflow-providers-amazon==6.0.0"><pre class="notranslate"><code class="notranslate">apache-airflow[celery,postgres,apache.hive,jdbc,mysql,ssh,amazon,google,google_auth]==2.4.2
apache-airflow-providers-amazon==6.0.0
</code></pre></div>
<h3 dir="auto">Deployment</h3>
<p dir="auto">Other Docker-based deployment</p>
<h3 dir="auto">Deployment details</h3>
<p dir="auto">We are running a docker inside Fargate ECS on AWS.</p>
<p dir="auto">The following environment variables + config in CloudFormation control remote logging:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="            - Name: AIRFLOW__LOGGING__REMOTE_LOGGING
              Value: True
            - Name: AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER
              Value: !Sub &quot;cloudwatch://${TasksLogGroup.Arn}&quot;"><pre class="notranslate"><code class="notranslate">            - Name: AIRFLOW__LOGGING__REMOTE_LOGGING
              Value: True
            - Name: AIRFLOW__LOGGING__REMOTE_BASE_LOG_FOLDER
              Value: !Sub "cloudwatch://${TasksLogGroup.Arn}"
</code></pre></div>
<h3 dir="auto">Anything else</h3>
<p dir="auto">We did not change any other configuration during the upgrade, simply bumped the requirements for provider list + docker image from 2.4.1 to 2.4.2.</p>
<h3 dir="auto">Are you willing to submit PR?</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Yes I am willing to submit a PR!</li>
</ul>
<h3 dir="auto">Code of Conduct</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow this project's <a href="https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md">Code of Conduct</a></li>
</ul>