-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Currently, all logging displayed in the Airflow UI (which is controlled by the airflow.task logger) consistently shows logs in DEBUG mode, regardless of the intended log level.
Root Cause
The root of this behavior can be traced to this line in the Stackable Airflow operator:
for logger_name, logger_config in LOGGING_CONFIG['loggers'].items():
logger_config['level'] = logging.NOTSETSetting the log level to NOTSET effectively disables any filtering on the logger level, causing all log messages (including DEBUG) to be emitted.
Additionally, there is a no-op on line 116:
if logger_name != 'airflow.task':
logger_config['propagate'] == True # This uses '==' instead of '=' and has no effect.This is a comparison instead of an assignment, so the intended propagation setting is not applied.
Suggested Improvement
Instead of mutating all loggers, we can explicitly override only the airflow.task logger:
LOGGING_CONFIG['loggers']['airflow.task'] = {
'level': logging.INFO, # <---- this is important
'handlers': ['task'],
'filters': ['mask_secrets'],
'propagate': True,
}Current Workaround
For now, we are overriding the entire log_config.LOGGING_CONFIG in our deployment to enforce the desired logging behavior and levels.