vsilviaMO opened a new issue, #50274:
URL: https://github.com/apache/airflow/issues/50274

   ### Apache Airflow version
   
   3.0.0
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Running Airflow 2.10.0 and 3.0.0 through modified sample Docker Compose 
files to compare and understand changes.
   
   In airflow.cfg for 3.0.0, the log_format is defined as:
   `log_format = [%%(asctime)s] {%%(filename)s:%%(lineno)d} %%(levelname)s - 
%%(message)s`
   
   However, the output doesn't match:
   `[2025-05-06, 10:06:11] INFO - File processing completed successfully: 
source="utils.common_tasks_v4"
   `
   
   Instead of the filename and lineno being between the timestamp and the 
level, as the log_format would suggest, the filename is being appended to the 
message with a "source=<filename>" and without a lineno. I'm not sure where 
"source=<filename>" is coming from in the log formatting string.
   
   Also, comparing the actual log files instead of the UI output, the log lines 
are converted to JSON in 3.0.0:
   `{"timestamp":"2025-05-06T17:06:12.101090","level":"info","event":"File 
processing completed successfully","logger":"utils.common_tasks_v4"}`
   
   But, in the airflow.cfg file, json_format is set to False, as it is in 
2.10.0. So for some reason, the logging settings for 3.0.0 are being ignored 
while in 2.10.0 they are being enforced and I'm not sure what the difference is.
   
   ### What you think should happen instead?
   
   I would expect the output then to match Airflow 2.10.0 output, as in:
   `[2025-04-30, 23:04:21 UTC] {common_tasks_v4.py:45} INFO - File processing 
completed successfully`
   
   Especially considering that the log_format values match in both airflow.cfg 
files and that the docker-compose.yaml file has no environment variables 
overriding the airflow.cfg file.
   
   Also, I would expect the actual log files to not be in JSON format since the 
json_format config parameter is set to False. The settings are the same in my 
Airflow 2.10.0 instances and the output matches the UI:
   `[2025-04-10T17:15:01.220+0000] {common_tasks_v4.py:35} INFO - File 
processing completed successfully`
   
   
   ### How to reproduce
   
   Using the sample Airflow 3.0.0 docker-compose and a sample Dockerfile with 
no changes to logging settings, run a dag with logging statements.
   
   ### Operating System
   
   apache/airflow:3.0.0 docker image
   
   ### Versions of Apache Airflow Providers
   
   Snowflake
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to