我使用Django与FastCGI + nginx。在这种情况下,日志(错误)存储在哪里?
当前回答
我在/usr/local/nginx/logs/*目录中找到了它。
其他回答
在终端输入以下命令:
sudo cat /var/log/nginx/error.log
错误存储在nginx日志文件中。你可以在nginx配置文件的根目录中指定:
error_log /var/log/nginx/nginx_error.log warn;
在带Homebrew的Mac OS X上,默认情况下在以下位置找到日志文件:
/usr/local/var/log/nginx
cd /var/log/nginx/
cat error.log
Linux服务器上的日志位置:
Apache – /var/log/httpd/
IIS – C:\inetpub\wwwroot\
Node.js – /var/log/nodejs/
nginx – /var/log/nginx/
Passenger – /var/app/support/logs/
Puma – /var/log/puma/
Python – /opt/python/log/
Tomcat – /var/log/tomcat8
对于Mac OS用户,可以在终端中输入nginx -help。
nginx version: nginx/1.21.0
Usage: nginx [-?hvVtTq] [-s signal] [-p prefix]
[-e filename] [-c filename] [-g directives]
Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-T : test configuration, dump it and exit
-q : suppress non-error messages during configuration testing
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /opt/homebrew/Cellar/nginx/1.21.0/)
-e filename : set error log file (default: /opt/homebrew/var/log/nginx/error.log)
-c filename : set configuration file (default: /opt/homebrew/etc/nginx/nginx.conf)
-g directives : set global directives out of configuration file
然后,您可以为配置和日志文件找到一些默认路径,在这种情况下:
/opt/homebrew/log/nginx/error.log
推荐文章
- Django可选url参数
- 我如何提高一个响应禁止在django
- 使用Django South进行向后迁移
- 如何访问Django模板中的字典元素?
- Pylint在Visual Studio代码中“未解决的导入”错误
- 如何更改Django应用程序的名称?
- 在nginx中,上游是什么意思?
- Nginx中$host和$http_host的区别是什么
- 在django的form字段中默认创建空的queryset
- Nginx 403禁止所有文件
- 在django模型自定义save()方法中,你应该如何识别一个新对象?
- 从URL中获取参数
- PYTHONUNBUFFERED在docker文件中的用途是什么?
- 类没有对象成员
- Django模型“没有显式声明app_label”