在这里让我们一起学习,一起提高!

nginx 日志设置 FOR error_log 不指定

jed , 2012-5-10 13:52 , 服务器技术 , 评论(0) , 阅读(9392) , Via 本站原创
在你配置的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') 方法方便调试程序

Tags: ,
分页: 1/1 第一页 1 最后页 [ 显示模式: 摘要 | 列表 ]