首页 > 其他 > 详细

nginx日志格式

时间:2016-02-24 17:46:01      阅读:232      评论:0      收藏:0      [点我收藏+]


      Nginx中日志文件的格式在nginx.conf中定义,其默认格式如下:

      #vim /usr/local/nginx/conf/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’;

       其中,各个字段的含义如下:

       1.$remote_addr 与$http_x_forwarded_for 用以记录客户端的ip地址;
        2.$remote_user :用来记录客户端用户名称;
        3.$time_local : 用来记录访问时间与时区;
        4.$request : 用来记录请求的url与http协议;
        5.$status : 用来记录请求状态;成功是200,
        6.$body_bytes_s ent :记录发送给客户端文件主体内容大小;
        7.$http_referer :用来记录从那个页面链接访问过来的;
        8.$http_user_agent :记录客户端浏览器的相关信息;


本文出自 “蛮荒之力” 博客,转载请与作者联系!

nginx日志格式

原文:http://chenfei123.blog.51cto.com/1427669/1744649

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!