librelist archives

« back to archive

Re: [flask] How do I log request data on exception?

Re: [flask] How do I log request data on exception?

From:
Johannes Reichhardt
Date:
2012-12-05 @ 10:10
Hi Konrad,

Do it like
request.headers.getlist("X-Forwarded-For"):
   ip = request.remote_addr


Then you can write the variable as a message into the log as described in
the error handling doc.

Cheers,
Jones

On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com> wrote:

>Hi all
>
>I would like to configure logging in such a way that the request data
>(such as origin IP, target address, GET/POST data (truncated if too
>long))  is also written to the log. The document here:
>http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention how
>to do that. Could you suggest any solution for that?
>
>Cheers,
>Konrad
>

Re: [flask] How do I log request data on exception?

From:
klinkin
Date:
2012-12-05 @ 11:25
Hi Konrad,

If I understood you correctly, you can use something like this:

    ...
    app = Flask(__name__)
    ...
    @app.before_request
    def print_request():
        print "json = " + str(request.json)
        print "args = " + str(request.args)
        print "data = " + str(request.data)
        print "values = " + str(request.values)
        print "headers = " + str(request.headers)
        print "url = " + str(request.url)

See in docs before_request decorator 
http://flask.pocoo.org/docs/api/?highlight=before_request#flask.Flask.before_request


--  
Mike Klimin


среда, 5 декабря 2012 г. в 14:10, Johannes Reichhardt написал:

> Hi Konrad,
>  
> Do it like
> request.headers.getlist("X-Forwarded-For"):
> ip = request.remote_addr
>  
>  
> Then you can write the variable as a message into the log as described in
> the error handling doc.
>  
> Cheers,
> Jones
>  
> On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com 
(mailto:konrad.s@gmail.com)> wrote:
>  
> > Hi all
> >  
> > I would like to configure logging in such a way that the request data
> > (such as origin IP, target address, GET/POST data (truncated if too
> > long)) is also written to the log. The document here:
> > http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention how
> > to do that. Could you suggest any solution for that?
> >  
> > Cheers,
> > Konrad
> >  
>  
>  
>  

Re: [flask] How do I log request data on exception?

From:
Konrad Szyc
Date:
2013-01-07 @ 08:24
Hi again

Thank you for your answers.

You have given me examples on how to get data from "request" object
but I would also like to know how to put that specific data into the
log. The doc at http://flask.pocoo.org/docs/errorhandling/ gives
examples of some predefined format variables but that does not seem to
be enough information to put the aforementioned data into the log.
Could you help me on that?

Cheers,
Konrad

2012/12/5 klinkin <klinkin@gmail.com>:
> Hi Konrad,
>
> If I understood you correctly, you can use something like this:
>
>     ...
>     app = Flask(__name__)
>     ...
>     @app.before_request
>     def print_request():
>         print "json = " + str(request.json)
>         print "args = " + str(request.args)
>         print "data = " + str(request.data)
>         print "values = " + str(request.values)
>         print "headers = " + str(request.headers)
>         print "url = " + str(request.url)
>
> See in docs before_request decorator
> 
http://flask.pocoo.org/docs/api/?highlight=before_request#flask.Flask.before_request
>
> --
> Mike Klimin
>
> среда, 5 декабря 2012 г. в 14:10, Johannes Reichhardt написал:
>
> Hi Konrad,
>
> Do it like
> request.headers.getlist("X-Forwarded-For"):
> ip = request.remote_addr
>
>
> Then you can write the variable as a message into the log as described in
> the error handling doc.
>
> Cheers,
> Jones
>
> On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com> wrote:
>
> Hi all
>
> I would like to configure logging in such a way that the request data
> (such as origin IP, target address, GET/POST data (truncated if too
> long)) is also written to the log. The document here:
> http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention how
> to do that. Could you suggest any solution for that?
>
> Cheers,
> Konrad
>
>

Re: [flask] How do I log request data on exception?

From:
dorian i
Date:
2013-01-07 @ 10:27
Taken from that page:

By default if your application runs in production mode, Flask will display
a very simple page for you and log the exception to the
logger<http://flask.pocoo.org/docs/api/#flask.Flask.logger>
.

On Mon, Jan 7, 2013 at 9:24 AM, Konrad Szyc <konrad.s@gmail.com> wrote:

> Hi again
>
> Thank you for your answers.
>
> You have given me examples on how to get data from "request" object
> but I would also like to know how to put that specific data into the
> log. The doc at http://flask.pocoo.org/docs/errorhandling/ gives
> examples of some predefined format variables but that does not seem to
> be enough information to put the aforementioned data into the log.
> Could you help me on that?
>
> Cheers,
> Konrad
>
> 2012/12/5 klinkin <klinkin@gmail.com>:
> > Hi Konrad,
> >
> > If I understood you correctly, you can use something like this:
> >
> >     ...
> >     app = Flask(__name__)
> >     ...
> >     @app.before_request
> >     def print_request():
> >         print "json = " + str(request.json)
> >         print "args = " + str(request.args)
> >         print "data = " + str(request.data)
> >         print "values = " + str(request.values)
> >         print "headers = " + str(request.headers)
> >         print "url = " + str(request.url)
> >
> > See in docs before_request decorator
> >
> 
http://flask.pocoo.org/docs/api/?highlight=before_request#flask.Flask.before_request
> >
> > --
> > Mike Klimin
> >
> > среда, 5 декабря 2012 г. в 14:10, Johannes Reichhardt написал:
> >
> > Hi Konrad,
> >
> > Do it like
> > request.headers.getlist("X-Forwarded-For"):
> > ip = request.remote_addr
> >
> >
> > Then you can write the variable as a message into the log as described in
> > the error handling doc.
> >
> > Cheers,
> > Jones
> >
> > On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com> wrote:
> >
> > Hi all
> >
> > I would like to configure logging in such a way that the request data
> > (such as origin IP, target address, GET/POST data (truncated if too
> > long)) is also written to the log. The document here:
> > http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention how
> > to do that. Could you suggest any solution for that?
> >
> > Cheers,
> > Konrad
> >
> >
>

Re: [flask] How do I log request data on exception?

From:
Konrad Szyc
Date:
2013-01-07 @ 11:32
Dorian,

Thank you for your time taken to answer my question but I believe that
your answer does not address my specific need. What I would like to do
is to use the logger to store some custom information (ie. GET/POST
vars,  client remote address and so on) along with the exception.

Let me rephrase my problem:

I am running an application on live production server and I am using a
logger to write errors to file and also send them via SMTP. The
application does some non-trivial operations on request variables to
compute a query which is then passed to the database. Occasionally , I
get exceptions that tell me that my operations on request variables do
not work for some specific request variables. I want to debug that. I
need to learn what request data lead to unexpected behavior. An
exception along with a stack trace does not tell me that. I need to
store that request data when exception arises so that I can reproduce
the error in a development environment.


2013/1/7 dorian i <dorian.hoxha@gmail.com>:
> Taken from that page:
>
> By default if your application runs in production mode, Flask will display a
> very simple page for you and log the exception to the logger.
>
>
> On Mon, Jan 7, 2013 at 9:24 AM, Konrad Szyc <konrad.s@gmail.com> wrote:
>>
>> Hi again
>>
>> Thank you for your answers.
>>
>> You have given me examples on how to get data from "request" object
>> but I would also like to know how to put that specific data into the
>> log. The doc at http://flask.pocoo.org/docs/errorhandling/ gives
>> examples of some predefined format variables but that does not seem to
>> be enough information to put the aforementioned data into the log.
>> Could you help me on that?
>>
>> Cheers,
>> Konrad
>>
>> 2012/12/5 klinkin <klinkin@gmail.com>:
>> > Hi Konrad,
>> >
>> > If I understood you correctly, you can use something like this:
>> >
>> >     ...
>> >     app = Flask(__name__)
>> >     ...
>> >     @app.before_request
>> >     def print_request():
>> >         print "json = " + str(request.json)
>> >         print "args = " + str(request.args)
>> >         print "data = " + str(request.data)
>> >         print "values = " + str(request.values)
>> >         print "headers = " + str(request.headers)
>> >         print "url = " + str(request.url)
>> >
>> > See in docs before_request decorator
>> >
>> > 
http://flask.pocoo.org/docs/api/?highlight=before_request#flask.Flask.before_request
>> >
>> > --
>> > Mike Klimin
>> >
>> > среда, 5 декабря 2012 г. в 14:10, Johannes Reichhardt написал:
>> >
>> > Hi Konrad,
>> >
>> > Do it like
>> > request.headers.getlist("X-Forwarded-For"):
>> > ip = request.remote_addr
>> >
>> >
>> > Then you can write the variable as a message into the log as described
>> > in
>> > the error handling doc.
>> >
>> > Cheers,
>> > Jones
>> >
>> > On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com> wrote:
>> >
>> > Hi all
>> >
>> > I would like to configure logging in such a way that the request data
>> > (such as origin IP, target address, GET/POST data (truncated if too
>> > long)) is also written to the log. The document here:
>> > http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention how
>> > to do that. Could you suggest any solution for that?
>> >
>> > Cheers,
>> > Konrad
>> >
>> >
>
>

Re: [flask] How do I log request data on exception?

From:
dorian i
Date:
2013-01-07 @ 17:21
I understand. Look at here: https://github.com/getsentry (sentry is a
realtime event logging). It is open source and it has a library for python
which has a *plugin for Flask* that automatically catches the exceptions
and *passes some extra data to the exception logger* like (browser,other
stuff). See that source code and there you go. The library is called *raven*.
pip install raven.Then:
from raven.contrib.flask import *Sentry* (*see the source of this class* on
how it does it)


On Mon, Jan 7, 2013 at 12:32 PM, Konrad Szyc <konrad.s@gmail.com> wrote:

> Dorian,
>
> Thank you for your time taken to answer my question but I believe that
> your answer does not address my specific need. What I would like to do
> is to use the logger to store some custom information (ie. GET/POST
> vars,  client remote address and so on) along with the exception.
>
> Let me rephrase my problem:
>
> I am running an application on live production server and I am using a
> logger to write errors to file and also send them via SMTP. The
> application does some non-trivial operations on request variables to
> compute a query which is then passed to the database. Occasionally , I
> get exceptions that tell me that my operations on request variables do
> not work for some specific request variables. I want to debug that. I
> need to learn what request data lead to unexpected behavior. An
> exception along with a stack trace does not tell me that. I need to
> store that request data when exception arises so that I can reproduce
> the error in a development environment.
>
>
> 2013/1/7 dorian i <dorian.hoxha@gmail.com>:
> > Taken from that page:
> >
> > By default if your application runs in production mode, Flask will
> display a
> > very simple page for you and log the exception to the logger.
> >
> >
> > On Mon, Jan 7, 2013 at 9:24 AM, Konrad Szyc <konrad.s@gmail.com> wrote:
> >>
> >> Hi again
> >>
> >> Thank you for your answers.
> >>
> >> You have given me examples on how to get data from "request" object
> >> but I would also like to know how to put that specific data into the
> >> log. The doc at http://flask.pocoo.org/docs/errorhandling/ gives
> >> examples of some predefined format variables but that does not seem to
> >> be enough information to put the aforementioned data into the log.
> >> Could you help me on that?
> >>
> >> Cheers,
> >> Konrad
> >>
> >> 2012/12/5 klinkin <klinkin@gmail.com>:
> >> > Hi Konrad,
> >> >
> >> > If I understood you correctly, you can use something like this:
> >> >
> >> >     ...
> >> >     app = Flask(__name__)
> >> >     ...
> >> >     @app.before_request
> >> >     def print_request():
> >> >         print "json = " + str(request.json)
> >> >         print "args = " + str(request.args)
> >> >         print "data = " + str(request.data)
> >> >         print "values = " + str(request.values)
> >> >         print "headers = " + str(request.headers)
> >> >         print "url = " + str(request.url)
> >> >
> >> > See in docs before_request decorator
> >> >
> >> >
> 
http://flask.pocoo.org/docs/api/?highlight=before_request#flask.Flask.before_request
> >> >
> >> > --
> >> > Mike Klimin
> >> >
> >> > среда, 5 декабря 2012 г. в 14:10, Johannes Reichhardt написал:
> >> >
> >> > Hi Konrad,
> >> >
> >> > Do it like
> >> > request.headers.getlist("X-Forwarded-For"):
> >> > ip = request.remote_addr
> >> >
> >> >
> >> > Then you can write the variable as a message into the log as described
> >> > in
> >> > the error handling doc.
> >> >
> >> > Cheers,
> >> > Jones
> >> >
> >> > On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com> wrote:
> >> >
> >> > Hi all
> >> >
> >> > I would like to configure logging in such a way that the request data
> >> > (such as origin IP, target address, GET/POST data (truncated if too
> >> > long)) is also written to the log. The document here:
> >> > http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention
> how
> >> > to do that. Could you suggest any solution for that?
> >> >
> >> > Cheers,
> >> > Konrad
> >> >
> >> >
> >
> >
>

Re: [flask] How do I log request data on exception?

From:
Jonathan Zempel
Date:
2013-01-07 @ 17:39
You may also want to compare the www.exceptional.io cloud service, in which
case Flask-Exceptional
<http://packages.python.org/Flask-Exceptional/>should handle your
requirements.

*disclaimer - the Flask-Exceptional extension is mine ;-)


On Mon, Jan 7, 2013 at 9:21 AM, dorian i <dorian.hoxha@gmail.com> wrote:

> I understand. Look at here: https://github.com/getsentry (sentry is a
> realtime event logging). It is open source and it has a library for python
> which has a *plugin for Flask* that automatically catches the exceptions
> and *passes some extra data to the exception logger* like (browser,other
> stuff). See that source code and there you go. The library is called *
> raven*. pip install raven.Then:
> from raven.contrib.flask import *Sentry* (*see the source of this 
class*on how it does it)
>
>
> On Mon, Jan 7, 2013 at 12:32 PM, Konrad Szyc <konrad.s@gmail.com> wrote:
>
>> Dorian,
>>
>> Thank you for your time taken to answer my question but I believe that
>> your answer does not address my specific need. What I would like to do
>> is to use the logger to store some custom information (ie. GET/POST
>> vars,  client remote address and so on) along with the exception.
>>
>> Let me rephrase my problem:
>>
>> I am running an application on live production server and I am using a
>> logger to write errors to file and also send them via SMTP. The
>> application does some non-trivial operations on request variables to
>> compute a query which is then passed to the database. Occasionally , I
>> get exceptions that tell me that my operations on request variables do
>> not work for some specific request variables. I want to debug that. I
>> need to learn what request data lead to unexpected behavior. An
>> exception along with a stack trace does not tell me that. I need to
>> store that request data when exception arises so that I can reproduce
>> the error in a development environment.
>>
>>
>> 2013/1/7 dorian i <dorian.hoxha@gmail.com>:
>> > Taken from that page:
>> >
>> > By default if your application runs in production mode, Flask will
>> display a
>> > very simple page for you and log the exception to the logger.
>> >
>> >
>> > On Mon, Jan 7, 2013 at 9:24 AM, Konrad Szyc <konrad.s@gmail.com> wrote:
>> >>
>> >> Hi again
>> >>
>> >> Thank you for your answers.
>> >>
>> >> You have given me examples on how to get data from "request" object
>> >> but I would also like to know how to put that specific data into the
>> >> log. The doc at http://flask.pocoo.org/docs/errorhandling/ gives
>> >> examples of some predefined format variables but that does not seem to
>> >> be enough information to put the aforementioned data into the log.
>> >> Could you help me on that?
>> >>
>> >> Cheers,
>> >> Konrad
>> >>
>> >> 2012/12/5 klinkin <klinkin@gmail.com>:
>> >> > Hi Konrad,
>> >> >
>> >> > If I understood you correctly, you can use something like this:
>> >> >
>> >> >     ...
>> >> >     app = Flask(__name__)
>> >> >     ...
>> >> >     @app.before_request
>> >> >     def print_request():
>> >> >         print "json = " + str(request.json)
>> >> >         print "args = " + str(request.args)
>> >> >         print "data = " + str(request.data)
>> >> >         print "values = " + str(request.values)
>> >> >         print "headers = " + str(request.headers)
>> >> >         print "url = " + str(request.url)
>> >> >
>> >> > See in docs before_request decorator
>> >> >
>> >> >
>> 
http://flask.pocoo.org/docs/api/?highlight=before_request#flask.Flask.before_request
>> >> >
>> >> > --
>> >> > Mike Klimin
>> >> >
>> >> > среда, 5 декабря 2012 г. в 14:10, Johannes Reichhardt написал:
>> >> >
>> >> > Hi Konrad,
>> >> >
>> >> > Do it like
>> >> > request.headers.getlist("X-Forwarded-For"):
>> >> > ip = request.remote_addr
>> >> >
>> >> >
>> >> > Then you can write the variable as a message into the log as
>> described
>> >> > in
>> >> > the error handling doc.
>> >> >
>> >> > Cheers,
>> >> > Jones
>> >> >
>> >> > On 12/5/12 9:52 AM, "Konrad Szyc" <konrad.s@gmail.com> wrote:
>> >> >
>> >> > Hi all
>> >> >
>> >> > I would like to configure logging in such a way that the request data
>> >> > (such as origin IP, target address, GET/POST data (truncated if too
>> >> > long)) is also written to the log. The document here:
>> >> > http://flask.pocoo.org/docs/errorhandling/ doesn't seem to mention
>> how
>> >> > to do that. Could you suggest any solution for that?
>> >> >
>> >> > Cheers,
>> >> > Konrad
>> >> >
>> >> >
>> >
>> >
>>
>
>

Re: [flask] How do I log request data on exception?

From:
Shriram Kunchanapalli
Date:
2013-01-08 @ 02:41
Taking a look at File Logging in
http://flask.pocoo.org/docs/errorhandling/#file-logging
In Complex Log Formatting, "consult the official documentation of the
logging <http://docs.python.org/dev/library/logging.html#logging> package
for a full list"
Here 'debug' @
http://docs.python.org/dev/library/logging.html#logging.Logger.debug
has an example in that section with 'clientip' in it.
You can get the originIP and target address via following:

http://stackoverflow.com/questions/3759981/get-ip-address-of-visitors-using-python-specifically-flask-micro-framework
You can get target address via 'path', 'fullpath' and get/post variables
via 'args' from
http://werkzeug.pocoo.org/docs/wrappers/#werkzeug.wrappers.BaseRequest.remote_addr

Now, I'm not sure how to specify this in the Flask logger.

Re: [flask] How do I log request data on exception?

From:
Konrad Szyc
Date:
2013-01-08 @ 14:37
Hi all, Thank you for your replies. I think that I'm closer to the
solution that would satisfy my needs

From now on I am going to try one or both of the following (depending
on the outcome):
1. Follow suggestions of dorian i and Jonathan Zempel to try out some
existing logging solutions
2. Dig into logger documentation (as suggested by Shriram
Kunchanapalli) and maybe flask and werkzeug API/source code to learn
how exactly the logging handlers are used and how to make them work to
suit my needs.

I am going to get back to you if I get any results.

Best of luck,
Konrad

Thank you for your answers.

2013/1/8 Shriram Kunchanapalli <kshriram18@gmail.com>:
> Taking a look at File Logging in
> http://flask.pocoo.org/docs/errorhandling/#file-logging
> In Complex Log Formatting, "consult the official documentation of the
> logging package for a full list"
> Here 'debug' @
> http://docs.python.org/dev/library/logging.html#logging.Logger.debug
> has an example in that section with 'clientip' in it.
>
> You can get the originIP and target address via following:
> 
http://stackoverflow.com/questions/3759981/get-ip-address-of-visitors-using-python-specifically-flask-micro-framework
> You can get target address via 'path', 'fullpath' and get/post variables via
> 'args' from
> 
http://werkzeug.pocoo.org/docs/wrappers/#werkzeug.wrappers.BaseRequest.remote_addr
>
> Now, I'm not sure how to specify this in the Flask logger.

Re: [flask] How do I log request data on exception?

From:
dorian i
Date:
2013-01-08 @ 16:24
My suggestion was that you dig into raven plugin for flask and see how they
collect data and pass them to the logger. It was optional to use the
getsentry server.

On Tue, Jan 8, 2013 at 3:37 PM, Konrad Szyc <konrad.s@gmail.com> wrote:

> Hi all, Thank you for your replies. I think that I'm closer to the
> solution that would satisfy my needs
>
> >From now on I am going to try one or both of the following (depending
> on the outcome):
> 1. Follow suggestions of dorian i and Jonathan Zempel to try out some
> existing logging solutions
> 2. Dig into logger documentation (as suggested by Shriram
> Kunchanapalli) and maybe flask and werkzeug API/source code to learn
> how exactly the logging handlers are used and how to make them work to
> suit my needs.
>
> I am going to get back to you if I get any results.
>
> Best of luck,
> Konrad
>
> Thank you for your answers.
>
> 2013/1/8 Shriram Kunchanapalli <kshriram18@gmail.com>:
> > Taking a look at File Logging in
> > http://flask.pocoo.org/docs/errorhandling/#file-logging
> > In Complex Log Formatting, "consult the official documentation of the
> > logging package for a full list"
> > Here 'debug' @
> > http://docs.python.org/dev/library/logging.html#logging.Logger.debug
> > has an example in that section with 'clientip' in it.
> >
> > You can get the originIP and target address via following:
> >
> 
http://stackoverflow.com/questions/3759981/get-ip-address-of-visitors-using-python-specifically-flask-micro-framework
> > You can get target address via 'path', 'fullpath' and get/post variables
> via
> > 'args' from
> >
> 
http://werkzeug.pocoo.org/docs/wrappers/#werkzeug.wrappers.BaseRequest.remote_addr
> >
> > Now, I'm not sure how to specify this in the Flask logger.
>

Re: [flask] How do I log request data on exception?

From:
Konrad Szyc
Date:
2013-01-09 @ 10:08
I failed to see that you advised me to look into the source code. My
mistake. But your message motivated me to actually install the sentry
server and try it out. My first impression is very good. Possibly,
I'll just use it instead of extensive e-mail logging I was planning to
do. I like the fact that sentry can group similar errors and display
counts.

Thank you all for your time.

Cheers,
Konrad

2013/1/8 dorian i <dorian.hoxha@gmail.com>:
> My suggestion was that you dig into raven plugin for flask and see how they
> collect data and pass them to the logger. It was optional to use the
> getsentry server.
>
>
> On Tue, Jan 8, 2013 at 3:37 PM, Konrad Szyc <konrad.s@gmail.com> wrote:
>>
>> Hi all, Thank you for your replies. I think that I'm closer to the
>> solution that would satisfy my needs
>>
>> >From now on I am going to try one or both of the following (depending
>> on the outcome):
>> 1. Follow suggestions of dorian i and Jonathan Zempel to try out some
>> existing logging solutions
>> 2. Dig into logger documentation (as suggested by Shriram
>> Kunchanapalli) and maybe flask and werkzeug API/source code to learn
>> how exactly the logging handlers are used and how to make them work to
>> suit my needs.
>>
>> I am going to get back to you if I get any results.
>>
>> Best of luck,
>> Konrad
>>
>> Thank you for your answers.
>>
>> 2013/1/8 Shriram Kunchanapalli <kshriram18@gmail.com>:
>> > Taking a look at File Logging in
>> > http://flask.pocoo.org/docs/errorhandling/#file-logging
>> > In Complex Log Formatting, "consult the official documentation of the
>> > logging package for a full list"
>> > Here 'debug' @
>> > http://docs.python.org/dev/library/logging.html#logging.Logger.debug
>> > has an example in that section with 'clientip' in it.
>> >
>> > You can get the originIP and target address via following:
>> >
>> > 
http://stackoverflow.com/questions/3759981/get-ip-address-of-visitors-using-python-specifically-flask-micro-framework
>> > You can get target address via 'path', 'fullpath' and get/post variables
>> > via
>> > 'args' from
>> >
>> > 
http://werkzeug.pocoo.org/docs/wrappers/#werkzeug.wrappers.BaseRequest.remote_addr
>> >
>> > Now, I'm not sure how to specify this in the Flask logger.
>
>