On 13/11/24 8:10 am, Left Right wrote:
since logs are designed to grow indefinitely, the natural response to this design property is log rotation.
I don't see how writing logs to stderr solves that problem in any way. Whatever stderr is sent to still has a potentially unlimited amount of data to deal with.
But, it's impossible to reliably rotate a log file. There's always a chance that during the rotation some log entries will be written to the file past the point of rotation, but prior to the point where the next logs volume starts.
Not sure I follow you there. You seem to be thinking of a particular way of rotating log files, where an external process tries to swap the program's log file out from under it without its knowledge. That could be vulnerable to race conditions. But if the program doing the logging handles the rotation itself, there's no reason it has to lose data. -- Greg -- https://mail.python.org/mailman/listinfo/python-list