Nginx 错误日志配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx 错误日志配置相关的知识,希望对你有一定的参考价值。

错误日志可以在 nginx.conf 的全局配置(也就是main区块)中添加,也可以在不同虚拟主机配置文件中的全局配置中单独添加

语法:error_log  file  level;  // error_log 是固定的关键字,file 是错误日志的存放路径,level 是日志等级

配置实例:

worker_processes  1;
user nobody nobody;
pid /usr/local/nginx/nginx.pid;
error_log logs/error.log error;  //默认就是这样配置,所以不配置错误日志记录也可以,只有当有需求的时候才配置 events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name www.xxxxx.com; location / { root html/www; index index.html index.htm; } } }

 

 

 

 

     

以上是关于Nginx 错误日志配置的主要内容,如果未能解决你的问题,请参考以下文章

Nginx 错误日志配置

Nginx 错误日志配置

配置 Nginx 的访问日志和错误日志

Nginx 错误日志配置

nginx错误界面优化和日志管理

nginx php-fpm记录php错误日志怎么配置