You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/25 15:42:19 UTC

[GitHub] [airflow] ejstembler opened a new issue, #27265: Added ability to specify SQLAlchemy logging level

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

   ### Description
   
   Currently we are not seeing SQLAlchemy related logs.  It would be great to see the generated SQL SQLAlchemy generates.
   
   Please consider adding the ability to enable SQLAlchemy logging. Perhaps add a new ENV variable, `SQLALCHEMY_ENGINE_LOGGING_LEVEL`.
   
   ```python
   # wherever Airflow initializes SQLAlchemy
   
   import os
   import logging
   
   
   sqlalchemy_engine_logging_level = os.environ['SQLALCHEMY_ENGINE_LOGGING_LEVEL'].upper()
   logging_level = logging.getLevelName(sqlalchemy_engine_logging_level)
   
   logging.basicConfig()
   logging.getLogger('sqlalchemy.engine').setLevel(logging_level)
   ```
   
   
   
   ### Use case/motivation
   
   We want to be able to see the SQLAlchemy log entries.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a 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


[GitHub] [airflow] potiuk commented on issue #27265: Add ability to specify SQLAlchemy logging level

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #27265:
URL: https://github.com/apache/airflow/issues/27265#issuecomment-1296503222

   You can already today do it via "advanced logging configuration" as described in configuration: https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/logging-tasks.html#advanced-configuration. You just need to create local settings. deepcopy standard configuration and you can add any logging configuration there. 


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


[GitHub] [airflow] potiuk closed issue #27265: Add ability to specify SQLAlchemy logging level

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #27265: Add ability to specify SQLAlchemy logging level
URL: https://github.com/apache/airflow/issues/27265


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