You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "deepak4babu (via GitHub)" <gi...@apache.org> on 2025/12/02 18:08:18 UTC

[I] Debug logs of tasks are not logged even when logging level is set to DEBUG [airflow]

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

   ### Apache Airflow version
   
   Other Airflow 2/3 version (please specify below)
   
   ### If "Other Airflow 2/3 version" selected, which one?
   
   3.0.6
   
   ### What happened?
   
   Debug logs of tasks are not logged even when AIRFLOW__LOGGING__LOGGING_LEVEL is set to DEBUG
   
   ### What you think should happen instead?
   
   Debug logs in tasks should also be printed in logs.
   
   ### How to reproduce
   
   Create a sampe dag with debug logs like below
   Set AIRFLOW__LOGGING__LOGGING_LEVEL to Debug
   Run the dag
   
   ```python
   from datetime import datetime
   from airflow.sdk import task, dag
   import logging
   from time import sleep
   
   
   log = logging.getLogger(__name__)
   
   
   @dag(
       schedule="*/5 * * * *",
       start_date=datetime(2021, 1, 1),
       catchup=False,
   )
   def sample_debug_dag():
       @task()
       def sample_task1():
           for i in range(300):
               log.debug("Debug log", i)
               sleep(1)
           print("Test")
   
       sample_task1()
   
   sample_debug_dag()
   ```
   
   ### Operating System
   
   PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-celery==3.12.2
   apache-airflow-providers-cncf-kubernetes==10.7.0
   apache-airflow-providers-common-compat==1.7.3
   apache-airflow-providers-common-io==1.6.2
   apache-airflow-providers-common-sql==1.27.5
   apache-airflow-providers-fab==2.4.1
   apache-airflow-providers-ftp==3.13.2
   apache-airflow-providers-http==5.3.3
   apache-airflow-providers-imap==3.9.2
   apache-airflow-providers-postgres==6.2.3
   apache-airflow-providers-smtp==2.2.0
   apache-airflow-providers-sqlite==4.1.2
   apache-airflow-providers-standard==1.6.0
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   We use a slightly modified version of official helm chart
   
   ### 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: commits-unsubscribe@airflow.apache.org.apache.org

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


Re: [I] Debug logs of tasks are not logged even when logging level is set to DEBUG [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #58965:
URL: https://github.com/apache/airflow/issues/58965#issuecomment-3691864665

   It is essentially duplicate of https://github.com/apache/airflow/issues/59634 and it waits for @ashb @kaxil @amoghrajesh feedback on whether it was intentional behaviour - maybe there was a good reason for it


-- 
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-unsubscribe@airflow.apache.org

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


Re: [I] Debug logs of tasks are not logged even when logging level is set to DEBUG [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #58965: Debug logs of tasks are not logged even when logging level is set to DEBUG
URL: https://github.com/apache/airflow/issues/58965


-- 
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-unsubscribe@airflow.apache.org

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


Re: [I] Debug logs of tasks are not logged even when logging level is set to DEBUG [airflow]

Posted by "justinpakzad (via GitHub)" <gi...@apache.org>.
justinpakzad commented on issue #58965:
URL: https://github.com/apache/airflow/issues/58965#issuecomment-3765989194

   Just circling back on this, I saw that the related/duplicate issue (#59634) was closed, but the root log level is still hard coded as INFO, meaning we still cant use use the DEBUG logs with a user defined logger, so this issue still persists. Based on the conversation in #59634, it seems like it shouldn't be hard coded but I wasn't entirely sure if that was the conclusion. Happy to open a PR to make that change if that's the case. 
   


-- 
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-unsubscribe@airflow.apache.org

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


Re: [I] Debug logs of tasks are not logged even when logging level is set to DEBUG [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on issue #58965:
URL: https://github.com/apache/airflow/issues/58965#issuecomment-3766813309

   @justinpakzad feel free to open up a PR for discussion if the issue you intended isn't fixed. Reviewers will be happier to discuss on the PR


-- 
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-unsubscribe@airflow.apache.org

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


Re: [I] Debug logs of tasks are not logged even when logging level is set to DEBUG [airflow]

Posted by "justinpakzad (via GitHub)" <gi...@apache.org>.
justinpakzad commented on issue #58965:
URL: https://github.com/apache/airflow/issues/58965#issuecomment-3690361683

   Hey, I would like to work on this issue.
   
   I ran some tests with the example dag provided and when we have the logger set to the airflow task log: 
   `log = logging.getLogger("airflow.task")` the debug output works fine. 
   
   I did some digging and I found that in the `configure_logging` function, the root logger level is hard coded to INFO  
   `config["root"] = {
           "handlers": ["default"],
           "level": "INFO",
           "propagate": True,
      }`
   
   Since the user defined loggers like the one in the example above inherits from the root, it wouldn't pick up the DEBUG level even if AIRFLOW__LOGGING__LOGGING_LEVEL=DEBUG is set. 
   
   Is that the expected behavior? If it's a bug then I think the fix would be to replace the hard-coded INFO value with log_level.upper(). Happy to open a PR if that's the case. Thanks.


-- 
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-unsubscribe@airflow.apache.org

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