1
zuroc 2013-01-12 00:12:24 +08:00 1
work@vps272 ~ $ eix logrotate
[I] app-admin/logrotate Available versions: 3.7.8 ~3.7.9 3.7.9-r1 ~3.7.9-r2 3.8.0 3.8.1 {acl selinux} Installed versions: 3.8.1(05:41:02 AM 02/24/2012)(acl -selinux) Homepage: https://fedorahosted.org/logrotate/ Description: Rotates, compresses, and mails system logs |
3
1ang 2013-02-26 12:49:11 +08:00
Tornado 本身就是用的Python原生的logging模块,所以任何logging.handlers里的你都可以拿来使用,如果你想按照天生成的话,可以看看TimedRotatingFileHandler (http://docs.python.org/2/library/logging.handlers.html#timedrotatingfilehandler) 把 when 和 interval 设置好就可以了
|
4
fishsjoy 2013-03-01 11:47:56 +08:00
参数logging=none,禁止tornado配置日志。然后在入口文件里自己调用logging模块添加TimedRotatingFileHandler
|
5
gavinzgz 2015-02-01 00:11:22 +08:00
折腾一天搞定了,请参照: http://guoze.me/2015/01/31/tornado-log-preday/
|
6
gavinzgz 2015-02-01 00:19:29 +08:00 1
URL错了,抱歉,应该是: http://guoze.me/2015/01/31/tornado-log-perday/
|
7
lawlietfans 2017-05-09 11:00:57 +08:00
options.define("log_rotate_when", type=str, default='D',
help=("specify the type of TimedRotatingFileHandler interval " "other options:('S', 'M', 'H', 'D', 'W0'-'W6')")) # 单位 options.define("log_rotate_interval", type=int, default=1, help="The interval value of timed rotating") # 时长 组合起来是 1 天 http://www.tornadoweb.org/en/stable/_modules/tornado/log.html |