N
N
nano_e_t_42016-01-20 13:06:32
Flask
nano_e_t_4, 2016-01-20 13:06:32

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

1 answer(s)
S
southsoutheast, 2016-01-20
@nano_e_t_4

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 question

Ask a Question

731 491 924 answers to any question