Colored_console_log=False not affecting all Airflow processes
Apache Airflow version
main (development)
If "Other Airflow 2 version" selected, which one?
No response
What happened?
I was attempting to disable colored logs that we have with the new struct logging (since where I'm uploading the logs doesn't support colors and the show as terminal escape sequences which are difficult to read). But when setting AIRFLOW__LOGGING__COLORED_CONSOLE_LOG=False only some of the Airflow processes respect this configuration. The API server and Triggerer seem to ignore the disabled colors.
Color Enabled:
Color Disabled:
What you think should happen instead?
All processes should log to stdout with no color
How to reproduce
Start and Airflow environment with and without this option set and observe the differences (in my case I used breeze).
Operating System
Linux Dockerized
Versions of Apache Airflow Providers
No response
Deployment
Docker-Compose
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Proposed solution:
The configuration should be applied at the shared logging setup boundary used by every Airflow process, rather than only by the processes that currently initialize the console renderer with colored_console_log. The API server and Triggerer should receive the same resolved value as the scheduler, workers, and DAG processor.
A focused implementation would be:
- Trace where the structlog/console renderer is built for the API server and Triggerer.
- Route those paths through the common logging configuration and use
[logging] colored_console_logwhen constructing the renderer. - Keep the current default unchanged.
- Add regression tests that initialize each affected process logger with the option set to
Falseand assert that emitted stdout contains no ANSI color sequences; also retain a test thatTruepreserves the existing behavior.
The important part is testing process-specific logger initialization, since the setting already works for some processes and the regression is in the remaining startup paths.