How to register from handlers to tornadoes in the console?

How to register from handlers to tornadoes in the console? I started the application from the console and set the logging.getLogger().setLevel(logging.DEBUG) handlers above

and internal handlers

 logging.info('RECEIVED HTTP GET REQUEST') 

but nothing is written to the console from handlers. I tried with printing, but it does not work inside the handlers.

+1
source share
1 answer

You can try by importing tornado.options

https://github.com/facebook/tornado/blob/branch2.4/tornado/options.py

Line 465 - 468:

 define("logging", default="info", help=("Set the Python log level. If 'none', tornado won't touch the " "logging configuration."), metavar="debug|info|warning|error|none") 

This register code block registers the "log" as a command-line argument in the tornado command-line parser and sets a default value for the information.

In the development version, they moved it to the function 'define_logging_options' * in the tornado.log module.

+3
source

Source: https://habr.com/ru/post/958665/


All Articles