Enable different log level for airflow classes than the one defined globally #31948
-
Apache Airflow version2.5.3 What happenedWe are running into an issue where metrics in Grafana show executor running tasks do not get cleared and over time accumulate. It results in Airflow progressively slowing down where we need to restart scheduler every 2-3 weeks and things go back to normal. However, before I open that bug, I wanted to make sure that it is not something related to a DAG implementation. And I would like to get one specific debug log out of That code is located here. Since I use Long story short, I am unable to configure debug logging only for these classes. The global log level setting of The log configuration is: from copy import deepcopy
# import the default logging configuration
from airflow.config_templates.airflow_local_settings import DEFAULT_LOGGING_CONFIG
LOGGING_CONFIG = deepcopy(DEFAULT_LOGGING_CONFIG)
LOGGING_CONFIG['loggers']['airflow_executors_kubernetes_executor'] = {
"class": "airflow.executors.kubernetes_executor",
"handlers": ["console"],
"level": 'DEBUG',
"propagate": True,
}
LOGGING_CONFIG['loggers']['airflow_jobs_scheduler_job'] = {
"class": "airflow.jobs.scheduler_job",
"handlers": ["console"],
"level": 'DEBUG',
"propagate": True,
}I have validated that the log configuration is loaded correctly by looking at the output of cli command I can also see the following line in the logs: What you think should happen insteadThe How to reproduceConfigure custom logging. This setup may vary for everyone. I set it up in a dockerfile like this: Operating SystemMacOS Ventura 13.1 Versions of Apache Airflow ProvidersThe This file contains the dependencies required by DAGs and is used to build the Airflow docker image.Alphabeticalaiofiles==23.1.0 DeploymentOfficial Apache Airflow Helm Chart Deployment detailsI am using Airflow provided docker-compose file. It can be found here The Airflow version I am using is 2.5.3. Anything elseEvery time. Are you willing to submit PR?
Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is very, very, very, very niche case. I suggest in this case you simply patch the class in question and change log level to info in your image that should be a simple SED command to replace specific If you want to discuss it further - feel free, but complexity to configure something like you want in a configurable way, comparing to you patching single class is incomparable. |
Beta Was this translation helpful? Give feedback.
This is very, very, very, very niche case.
I suggest in this case you simply patch the class in question and change log level to info in your image that should be a simple SED command to replace specific
log.debugintolog.infoIf you want to discuss it further - feel free, but complexity to configure something like you want in a configurable way, comparing to you patching single class is incomparable.