Python Tornado 中的 AttributeError 配置日志到文件

AttributeError in Python Tornado to configure log into a file

当我尝试配置我的 Python Tornado Web 服务器以登录文件时,我总是得到一个 AttributeError: 'NoneType' object has no attribute 'set' 异常。

在我用来执行此操作的代码下方:

tornado.options.options["log_file_prefix"].set("local.log")

我试图通过文档和互联网上的一些示例,但我没有找到任何东西。

我正在使用 tornado 4.2.1Python 2.7.9.

你有什么建议吗?

提前致谢。

使用属性赋值语法:

tornado.options.options.log_file_prefix = "local.log"