在这里让我们一起学习,一起提高!
在你配置的NGINX nginx.conf中加入如下代码
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /home/wwwlogs/access.log access;
error_log logs/nginx_error.log debug;
error_page 404 = /404.php;
error_log 日志分为
nginx的log有以下几种类型: [ debug | info | notice | warn | error | crit ]
在nginx.conf的设置:error_log logs/error.log debug;
debug 为最详细 crit最少
在页面里使用 error_log('this is error log') 方法方便调试程序
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log /home/wwwlogs/access.log access;
error_log logs/nginx_error.log debug;
error_page 404 = /404.php;
error_log 日志分为
nginx的log有以下几种类型: [ debug | info | notice | warn | error | crit ]
在nginx.conf的设置:error_log logs/error.log debug;
debug 为最详细 crit最少
在页面里使用 error_log('this is error log') 方法方便调试程序