【发布时间】:2015-12-21 21:21:15
【问题描述】:
我在 django 中使用 python 日志记录,我想将错误记录到 var/log 文件夹。我收到此错误:
Unable to configure handler 'exception_logs': [Errno 2] No such file or directory: '/var/log/exceptions.log'
下面是我在settings.py中的代码sn-p
'handlers': {'exception_logs': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'formatter': 'simple',
'filename': '/var/log/exceptions.log',
},
},
【问题讨论】:
标签: django python-3.x logging error-logging