Currently debug logging goes only to stderr.
This should be enhanced in a way that logging can go to either stderr (like now) or sent to an internal queue where debug entries can be:
a) written on a log file
b) sent to SQLite3
c) both a and b
Another option is to log on trace files of configurable length and numbers.
Debug function should have a global mutex to open/close/rotate such log files.
Admin should also implement the command FLUSH LOGS to rotate such logs.
I think operationally having the ability to set log rotation to be done daily would be great. Not sure if this is already possible.
PROXYSQL FLUSH LOGS
It already exists: it closes and re-open the files.
So the way of rotating log is similar to mysql error log: move the file, flush, so a new one will be created.