Log rotation for scheduler logs
Description Currently airflow scheduler doesn't support any kind of log rotation which cause scheduler to go down.
Use case / motivation A log rotation based upon duration/size will make sure scheduler's disks are not filled and will not cause downtime for scheduler.
Related Issues Worker logs cleanup can be currently done via maintenance dag but same is not possible for scheduler logs.
Thanks for opening your first issue here! Be sure to follow the issue template!
We solved this removing old logs after x days but out of the box rotating would be nice.
Our internal environment enforces mandatory log rotation automatically as part of its log rotation and archiving mechanism. Since the description of this ticket points out that external log rotation causes the Scheduler to go down (I am assuming this means crash), this leaves me hanging.
External log rotators are pretty common. For maximum compatibility, all Airflow subsystems need to play nice with external log rotators.
But this external log deletion dag / script doesn't seem to cause the scheduler to go down https://github.com/teamclairvoyant/airflow-maintenance-dags/blob/master/log-cleanup/airflow-log-cleanup.py
Would love to see this feature implemented We are too handling this through cronjob and it would be great to have a native solution.
Yes, this function would be very useful for us. Rotating the scheduler logs in the ECS container out of the box would be great.
In modern deployments logs are handled usually by the deployment/externally. I do not think rotating the logs makes airflow Crash (that would be pretty suriprising given than airlfow uses standard python logging). I am closing that one unless some provides some arguments why it should be implement, or shows how external log rotation crashes airflow.