Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (16 sloc) 506 Bytes
import sys, logging
from wsgilog import WsgiLog, LogIO
import config
class Log(WsgiLog):
def __init__(self, application):
WsgiLog.__init__(
self,
application,
logformat = '%(message)s',
tofile = True,
file = config.log_file,
interval = config.log_interval,
backups = config.log_backups
)
sys.stdout = LogIO(self.logger, logging.INFO)
sys.stderr = LogIO(self.logger, logging.ERROR)