I use standard RotatingFileHandler
within my Flask application with next parameters: maxBytes=10 * 1024 * 1024, backupCount=50
. App is managed by uWSGI behind nginx. uWSGI config file part looks like this:
processes = 16
enable-threads = true
threads = 10
Right after start of an app everything (I mean logging) works well. But after first log file rotation some processes (and maybe threads too) continue writing to rotated file and some - to new one. It is obvious. But for me it is not so obvious how can I rotate log file in the way that all of my processes (and threads) start to write messages to new file.