You should think about this from the point of view of the question: "What code paths lead to a routine scrolling?". Once you know how this procedure is accomplished, you can decide how to start it.
Can a custom appender do this? Of course, but the code in the application will not work until you go through it to return to the square.
Regarding the question, βIn any case, to make the log roll at midnight without having another thread that wakes up and makes it roll?β, I would say that this question is equivalent to βIs it possible to get log to roll at midnight without running the code? " I am not trying to laugh at it or insult you, I am just trying to repeat the question in a way that I hope will answer it for you. :-)
The easiest way to solve this problem is to wake up and register to make the file rotate.
source share