Kache opened a new issue, #42432:
URL: https://github.com/apache/airflow/issues/42432
### Apache Airflow version
Other Airflow 2 version (please specify below)
### If "Other Airflow 2 version" selected, which one?
2.8.0
### What happened?
Running `airflow.utils.db.resetdb()` (e.g. in test suite) sets
`logging.root.level = Logging.WARNING`
It appears to apply the logging config at `airflow/alembic.ini`
### What you think should happen instead?
`resetdb()` as a framework util function for clearing db state, should not
modify application root logger config
### How to reproduce
```py
import logging
print(f"{logging.root.level=}")
logging.root.setLevel(logging.INFO)
print(f"{logging.root.level=}")
import airflow.utils.db
airflow.utils.db.resetdb()
print(f"{logging.root.level=}")
```
```sh
mkdir test_airflow_logging
cd test_airflow_logging
python -m venv .venv
. .venv/bin/activate
pip install "apache-airflow==2.10.1" --constraint
"https://raw.githubusercontent.com/apache/airflow/constraints-2.10.1/constraints-3.11.txt"
export AIRFLOW_HOME=$(PWD)
python logging_test.py
```
Outputs:
```
logging.root.level=30
logging.root.level=20
[2024-09-23T22:36:21.856-0700] {db.py:1702} INFO - Dropping tables that exist
[2024-09-23T22:36:22.463-0700] {migration.py:215} INFO - Context impl
SQLiteImpl.
[2024-09-23T22:36:22.463-0700] {migration.py:218} INFO - Will assume
non-transactional DDL.
[2024-09-23T22:36:22.464-0700] {migration.py:215} INFO - Context impl
SQLiteImpl.
[2024-09-23T22:36:22.464-0700] {migration.py:218} INFO - Will assume
non-transactional DDL.
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running stamp_revision -> 22ed7efa9da2
WARNI [airflow.models.crypto] empty cryptography key - values will not be
stored encrypted.
logging.root.level=30
```
### Operating System
Darwin Kevin-J6J9FXYF3L 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31
20:49:39 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6000 arm64
### Versions of Apache Airflow Providers
bare/vanilla Airflow install, see repro
### Deployment
Virtualenv installation
### Deployment details
repro does not use deployment
### 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]