[SPARK-3562]Periodic cleanup event logs

link #2391 
You could manage this value inside the thread itself and avoid having the fields for each thread and the extra code to pass it to this method.