You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jnstockley (via GitHub)" <gi...@apache.org> on 2026/03/05 14:04:51 UTC
[I] Unable to change log timestamp formats using logging config class or log formatter class [airflow]
jnstockley opened a new issue, #62937:
URL: https://github.com/apache/airflow/issues/62937
### Apache Airflow version
3.1.7
### If "Other Airflow 3 version" selected, which one?
_No response_
### What happened?
I am trying to change the timestamp of the logs, not for the access logs but specifically for the different Airflow components like the api-server, scheduler, etc.
I have used the `AIRFLOW__LOGGING__LOG_FORMAT` environment variable to change the format of the logs, and have used the `--log-config` argument to change the access log formats.
I have tried out `AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS` and `AIRFLOW__LOGGING__LOG_FORMATTER_CLASS` to change the timestamp of the actual components, and this is where the issue lies. They don't seem to be respected.
Below is what I have set the environment variables too, and the contents of the python files.
`AIRFLOW__LOGGING__LOGGING_CONFIG_CLASS=config.logging_config_class.LOGGING_CONFIG`
`AIRFLOW__LOGGING__LOG_FORMATTER_CLASS=config.log_formatter_class.TimestampConfig`
[logging_config_class.py](https://github.com/user-attachments/files/25769640/logging_config_class.py)
[log_formatter_class.py](https://github.com/user-attachments/files/25769649/log_formatter_class.py)
### What you think should happen instead?
The Airflow component logs should respect the mentioned environment variables
### How to reproduce
1. Create the above files in the `config` directory, which gets copied during the docker build process
2. Set the above environment vairables.
3. Using docker look at the Airflow component logs, the timestamps are not being updated correctly.
### Operating System
Debian
### Versions of Apache Airflow Providers
apache-airflow-providers-oracle==4.5.0
apache-airflow-providers-google==20.0.0
apache-airflow-providers-amazon==9.21.0
apache-airflow-providers-postgres==6.6.0
apache-airflow-providers-microsoft-mssql==4.5.0
apache-airflow-providers-common-sql==1.32.0
apache-airflow-providers-sftp==5.7.0
apache-airflow-providers-openai==1.7.2
apache-airflow-providers-fab==3.4.0
### Deployment
Other Docker-based deployment
### Deployment details
Custom Dockerfile based off of the official slim docker images
### 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: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unable to change log timestamp formats using logging config class or log formatter class [airflow]
Posted by "justinpakzad (via GitHub)" <gi...@apache.org>.
justinpakzad commented on issue #62937:
URL: https://github.com/apache/airflow/issues/62937#issuecomment-4017009603
So I had a look and I may be mistaken here but it appears that the struct log overrides the LOG_FORMATTER_CLASS that a user would provide. I think this is intentional because if we look at this block of code:
https://github.com/apache/airflow/blob/bae2c27e3ebf8a4368bd64cb7456fc360a2dd2f9/shared/logging/src/airflow_shared/logging/structlog.py#L525-L530
We can see the comment - remove whatever the user might have configured
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unable to change log timestamp formats using logging config class or log formatter class [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on issue #62937:
URL: https://github.com/apache/airflow/issues/62937#issuecomment-4033695730
Feel free.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unable to change log timestamp formats using logging config class or log formatter class [airflow]
Posted by "ShubhamGondane (via GitHub)" <gi...@apache.org>.
ShubhamGondane commented on issue #62937:
URL: https://github.com/apache/airflow/issues/62937#issuecomment-4017220146
I guess the issue is that the LOG_FORMATTER_CLASS still exists as a documented config option and silently does nothing for component logs which would confuse users. Maybe it makes sense to either add a deprecation warning for this setting, or provide a new way to configure the timestamp format ?
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Unable to change log timestamp formats using logging config class or log formatter class [airflow]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #62937: Unable to change log timestamp formats using logging config class or log formatter class
URL: https://github.com/apache/airflow/issues/62937
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org