<div dir="ltr">Hi Kevin,<div><br></div><div>What are you trying to accomplish with multiple log files?  In the past, the approach that I/we've taken is to just use a log aggregator.  Either, Splunk or ELK (ElasticSearch, LogStash, Kibana).</div><div><br></div><div>With both, you index all log messages and can then create reports or views for users independently.  </div><div><br></div><div>I know that ELK is really easy to set up and free.  </div><div><br></div><div>Would something like that work for you?</div><div><br></div><div>Regards,</div><div>Kelvin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 5:26 PM, Robert Grant <span dir="ltr"><<a href="mailto:robertlagrant@gmail.com" target="_blank">robertlagrant@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Kevin<div><br></div><div>Just a couple of quick questions:</div><div><br></div><div>1) Do you have enough users to just log to a database and record a username with each log line? Just a suggestion to consider.</div><div>2) Can you post a minimal, verifiable and complete example of your first attempt to give people something solid to critique?</div><div><br></div><div>Thanks</div><div><br></div><div><br></div><div>Rob</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Feb 1, 2016 at 8:55 PM, Kevin Stone <span dir="ltr"><<a href="mailto:Kevin.Stone@jax.org" target="_blank">Kevin.Stone@jax.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">




<div dir="ltr" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>​Hi,<br>
</p>
<p><br>
</p>
<p>I am not the most familiar with the python logging framework, and I think I need some help on developing an approach for creating user specific log files in Flask. It would be even better if someone has already done this before and could share their pattern.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>The problem I want to solve is this:<br>
</p>
<p>1) user1 and user2 both log in to the app<br>
</p>
<p>2) user1's activity is logged in "user1.log". user2's activity is logged in "user2.log". <br>
</p>
<p>3) No other user's activity should appear in that user's log file.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Ideally, I would like to tap into existing loggers that I have (e.g. the app logger and the SQLAlchemy logger), but I don't know if that is possible. My first naive attempt simply registers additional handlers at login time to the app.logger. This created
 the appropriate log files, but they had all activity from all users writing to them.<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Any help or advice would be appreciated.<br>
</p>
<p>Thanks,<br>
</p>
<p>-Kevin<br>
</p>
<p>The information in this email, including attachments, may be confidential and is intended solely for the addressee(s). If you believe you received this email by mistake, please notify the sender by return email as soon as possible.</p>
</div>

<br></div></div>_______________________________________________<br>
Flask mailing list<br>
<a href="mailto:Flask@python.org" target="_blank">Flask@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/flask" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/flask</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<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/mailman/listinfo/flask</a><br>
<br></blockquote></div><br></div>