Wastelander777 opened a new pull request, #61855:
URL: https://github.com/apache/airflow/pull/61855

   ### What does this PR support?
   I’m adding the possibility to define an environment variable to clean logs 
on a minute basis instead of just days, which is how it works right now.
   
   New variable: `AIRFLOW__LOG_RETENTION_MINUTES`
   
   ### Why?
   Many users, like @n-badtke-cg (the issue opener), need a more atomic way of 
getting rid of logs. In big projects, waiting a full day to clean logs isn't 
enough—the files pile up so fast that it makes debugging difficult and storage 
expensive.
   
   ### How?
   I’ve updated scripts/docker/clean-logs.sh with some conditional logic:
   
   If `AIRFLOW__LOG_RETENTION_MINUTES` is set and bigger than 0, the script 
uses find -mmin.
   
   Otherwise, it falls back to the existing -mtime (day-based) logic.
   The default is 0, so nothing changes for users unless they opt-in. This also 
makes it easy to "rollback" to daily cleanup just by setting the minutes back 
to 0.
   
   ### Backward Compatibility
   There are no breaking changes here. I’ve maintained the existing logic, and 
the new minute-level option follows the exact same structure that’s already 
there. If you don't touch the new variable, Airflow behaves exactly as it did 
before.
   
   ### Testing
   I verified this locally by creating test log files.
   Confirmed that it deletes files correctly based on minute-level thresholds.
   Confirmed it still falls back to day-based retention when the minute 
variable is 0 or unset.
   
   Closes #61814 


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to