<div dir="ltr">If you are using linux, I have always just used logrotate (<a href="https://linux.die.net/man/8/logrotate">https://linux.die.net/man/8/logrotate</a>) instead of having the app server handle this.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 12, 2018 at 7:25 AM, Skip Montanaro <span dir="ltr"><<a href="mailto:skip.montanaro@gmail.com" target="_blank">skip.montanaro@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to use the TimedRotatingFileHandler in a Flask+uwsgi app. I<br>
pass "when='midnight'" to the class instantiation:<br>
<br>
    handler = logging.handlers.<wbr>TimedRotatingFileHandler("/<wbr>path/to/logfile.log",<br>
when='midnight')<br>
<br>
That starts off okay. When I come in the next morning, I find<br>
<br>
/path/to/logfile.log<br>
/path/to/logfile.log-2018-10-<wbr>11<br>
<br>
which, at first glance seems fine. Unfortunately, both files are open<br>
and receiving disjoint subsets of the log messages.<br>
<br>
My uwsgi options file contains<br>
<br>
processes = 2<br>
logger = python:/path/to/logfile.log<br>
<br>
the latter to catch the actual uwsgi log messages. That doesn't seem<br>
to be the culprit though, as I only set that up yesterday, and was<br>
getting the same behavior before. The messages which are distributed<br>
across the files are my application log messages, which leads me to<br>
believe I'm going to need to do something different to set up logfile<br>
rotation.<br>
<br>
Any suggestions about how to accomplish this?<br>
<br>
Thanks,<br>
<br>
Skip Montanaro<br>
______________________________<wbr>_________________<br>
Flask mailing list<br>
<a href="mailto:Flask@python.org">Flask@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/flask</a><br>
</blockquote></div><br></div>