1
我在django中使用python日誌記錄,我想將錯誤記錄到var/log文件夾。我收到此錯誤:如何給var/log文件夾寫入權限以記錄錯誤
Unable to configure handler 'exception_logs': [Errno 2] No such file or directory: '/var/log/exceptions.log'
下面是settings.py
'handlers': {'exception_logs': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'formatter': 'simple',
'filename': '/var/log/exceptions.log',
},
},
工作!謝謝 ! –
我已經嘗試過與wordpress例如,這樣做並不重要。/var/log/httpd /文件夾中的自定義PHP應用程序日誌文件未被寫入。 –