'Why is "INFO" logging not working on Airflow?

Problem In my DAG, I'm having trouble identifying what's wrong with my logging. The following is included at the beginning of my DAG:

logger = logging.getLogger(__name__)
logger.info(f'logger info')
logger.warning(f'logger warning')
logging.info(f'logging info')
logging.warning(f'logging warning')
print('print here', file=stderr)

This is the result:

[2022-02-02, 16:24:28 UTC] {subprocess.py:89} INFO - logger warning
[2022-02-02, 16:24:28 UTC] {subprocess.py:89} INFO - WARNING:root:logging warning
[2022-02-02, 16:24:28 UTC] {subprocess.py:89} INFO - print here

In my airflow.cfg, the following log level is defined:

# Supported values: ``CRITICAL``, ``ERROR``, ``WARNING``, ``INFO``, ``DEBUG``.
logging_level = INFO

Question What is happening here? Why would my "INFO" logs not show?

Context I'm looking at the logs through the Airflow web server interface while running the airflow standalone instance on Airflow 2.2.3



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source