我使用Django与FastCGI + nginx。在这种情况下,日志(错误)存储在哪里?
当前回答
在终端输入以下命令:
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
我在寻找另一种解决方案。
错误日志,默认情况下,在任何配置设置之前,在我的系统(x86 Arch Linux)上,在:
/var/log/nginx/error.log
cd /var/log/nginx/
cat error.log
对于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
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
推荐文章
- 如何在django应用程序中显示favicon ?
- 如何在Django中设置时区
- Nginx提供下载。php文件,而不是执行它们
- django导入错误-没有core.management模块
- 如何从外部访问本地Django web服务器
- NGINX 499错误码的可能原因
- 在Django模型中存储电话号码的最佳方法是什么?
- 如何禁用django-rest-framework的管理风格的可浏览界面?
- 如何获取请求。Django-Rest-Framework序列化器中的用户?
- NGINX:从上游读取响应报头时超时(110:连接超时)
- 如何在Django模板中获得我的网站的域名?
- 在django Forms中定义css类
- 我应该在.gitignore文件中添加Django迁移文件吗?
- SQLAlchemy是否有与Django的get_or_create等价的函数?
- 如何选择一个记录和更新它,与一个单一的查询集在Django?