码迷,mamicode.com
首页 > 其他好文 > 详细

nginx日志定制

时间:2017-08-24 21:24:32      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:nts   user   var   time   ima   分享   png   ons   nginx状态   

    1. 进入nginx安装目录
      cd /usr/local/nginx/

    2.  vi nginx.conf

      log_format lvan ‘$remote_addr - $remote_user [$time_iso8601] "$request" $http_host ‘
      ‘$status $body_bytes_sent "$http_referer" ‘
      ‘"$http_user_agent" $http_x_forwarded_for ‘
      ‘"$upstream_addr" $upstream_status "$upstream_cache_status" "$upstream_http_content_type" $upstream_response_time "$request_time" $request_length $bytes_sent $server_name‘;

      技术分享
       
    3.  检查nginx状态
      /usr/local/nginx/sbin/nginx -t

      技术分享

    4. 重新加载nginx
      /usr/local/nginx/sbin/nginx -s reload
       

    5. 查看新的访问日志

       tail -100f  /var/log/nginx/mqpublish.iapi.ymatou.com.log

nginx日志定制

标签:nts   user   var   time   ima   分享   png   ons   nginx状态   

原文地址:http://www.cnblogs.com/chenjiazhu/p/7424993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!