我使用http://webpy.org/cookbook/logging中的示例,但它无效。
import sys, logging
from wsgilog import WsgiLog
import config
class Log(WsgiLog):
def __init__(self, application):
WsgiLog.__init__(
self,
application,
logformat = '%(message)s',
tofile = True,
toprint = True,
file = config.log_file,
interval = config.log_interval,
backups = config.log_backups
)
答案 0 :(得分:-2)
class Log(WsgiLog):
def __init__(self, application):
WsgiLog.__init__(
self,
application,
logformat = '%(message)s',
loglevel=logging.INFO,
tofile = True,
toprint = True,
file = 'log.txt',
interval ='s',
backups =1
)