简体   繁体   中英

How to logging with timed rotate file handler in Tornado?

I've asked a question (how to manage nohup.out file in Tornado) about how to handle nohup.out file automatically when running a Tornado web service.

And I decided to use the logging module of Tornado to write my log files. I read about the documents of Tornado. The logging module it provides doesn't have the TimedRotatingFileHandler , I still cannot manage the logging files as dates.

So I want to know how to use TimedRotatingFileHandler in the logging module of Tonado?

I have rotating log files with my Tornado install.

I add this logging config line at the Tornado app startup:

logging.config.dictConfig(yaml.load(open('logging.yaml', 'r')))

and then include a logging.yaml that looks something like this gist :

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM