Answer the question
In order to leave comments, you need to log in
How to do logging?
Hello
Plz tell me how to do logging in flask? more specifically, to log server responses:
* Running on 127.0.0.1:5000 (Press CTRL+C to quit)
127.0.0.1 - - [20/Jan/2016 13:04:09] "GET / HTTP/1.1" 200 -
127.0 .0.1 - - [20/Jan/2016 13:04:09] "GET /static/css/styles.css HTTP/1.1" 200 -
written to the specified log?
did like this:
logger.setLevel(logging.DEBUG)
setLevel(logging.DEBUG)
logger.addHandler(file_handler)
but in this case it writes only debug messages/errors. Request statuses are still poured into the console.
I understand the logging module, but in relation to my task, I have not yet found a solution
Thank you
Answer the question
In order to leave comments, you need to log in
in the same logging module there is an "INFO" level.
construction logger.info(<любое сообщение>)
, you can display any information you need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question