jedcunningham opened a new issue #19058:
URL: https://github.com/apache/airflow/issues/19058


   ### Apache Airflow version
   
   2.2.0 (latest released)
   
   ### Operating System
   
   MacOS 11.6
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   Task logs for manual runs are being appended to the last scheduled runs log 
file.
   
   It seems like it isn't using the `logical_date` (aka `execution_date`) for 
determining the logfile path (though I haven't dug in at all).
   
   ### What you expected to happen
   
   Each dagrun to have it own, unique log file.
   
   ### How to reproduce
   
   If you enable this DAG:
   
   ```
   from datetime import datetime
   from airflow import DAG
   from airflow.operators.bash_operator import BashOperator
   
   with DAG(
       "manual_run_execution_date",
       start_date=datetime(2021, 10, 14),
       schedule_interval="0 0 * * *",
   ) as dag:
       test = BashOperator(task_id="test", bash_command="echo HI")
   ```
   
   Once the scheduled runs finish, bring up the log for the last scheduled run 
(and keep the tab open).
   Now schedule a manual run via the UI, wait for it to finish, then look at 
the log for the manual run.
   Note that you'll see 2 runs, one from the scheduler run and one from the 
manual run.
   Confirm with the last scheduled run tab you kept open.
   Note at the top of both, you'll see it's pulling from the same log file:
   
   ```
   *** Reading local file: 
/opt/airflow/logs/manual_run_execution_date/test/2021-10-17T00:00:00+00:00/1.log
   ```
   
   ### Anything else
   
   This is a regression in 2.2.0, I wasn't able to reproduce this in 2.1.4.
   
   ### 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)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to