【发布时间】:2015-01-06 18:26:07
【问题描述】:
我有一个 CherryPy 应用程序并启用了日志记录(访问和应用程序文件)。
conf = {'/':
{
'tools.staticdir.on': True,
'tools.staticdir.dir': WEB_ROOT,
'tools.staticdir.index': 'debug_registers2.html',
'log.access_file': ACCESS_LOG,
'log.error_file': APP_LOG,
}
}
除了默认的 CherryPy 日志数据,我还使用如下语句:
cherrypy.log("My text here")
现在我需要创建第三个日志文件,我将传递一些其他数据。 如果我这样做:
logging.basicConfig(filename=SPI_LOG,level=logging.DEBUG)
logging.debug('This message should go to the SPI log file')
我的 CherryPy 日志数据也进入“SPI_LOG”文件。
我怎样才能将两者分开?
【问题讨论】: