首頁 資料庫 mysql教程 [置顶] 详细解释:nginx中ChsHttpLogModule模块配置及各

[置顶] 详细解释:nginx中ChsHttpLogModule模块配置及各

Jun 07, 2016 pm 03:30 PM
nginx 置頂 解釋 詳細

ngx_http_log_module 实例: log_format gzip '$remote_addr - $remote_user [$time_local] ': '$request $status $bytes_sent ': '$http_referer $http_user_agent $gzip_ratio';access_log /spool/logs/nginx-access.log gzip buffer=32k; access_log 语法

ngx_http_log_module
实例:

log_format  gzip  '$remote_addr - $remote_user [$time_local]  '
: '"$request" $status $bytes_sent '
: '"$http_referer" "$http_user_agent" "$gzip_ratio"';
access_log  /spool/logs/nginx-access.log  gzip  buffer=32k;
登入後複製


access_log
语法: access_log path [format [buffer=size | off ] 默认值: access_log log/access.log combined

作用域: http, server, location

指令 access_log 指派路径、格式和缓存大小。参数 "off" 将清除当前级别的所有 access_log 指令。如果未指定格式,则使用预置的 "combined" 格式。缓存不能大于能写入磁盘的文件的最大大小。在 FreeBSD 3.0-6.0 ,缓存大小无此限制。


log_format
语法: log_format name format [format ...]

默认值: log_format combined "..."

作用域: http server

Directive log_format describes the format of a log entry. Besides general variables in the format it is possible to use variables which exist only at the moment of record into the log:

$body_bytes_sent, the number of bytes, transmitted to client minus the response headers, variable is compatible with parameter %B of module Apache's mod_log_config (this was called $apache_bytes_sent, before version 0.3.10)
$bytes_sent, the number of bytes, transmitted to client
$connection, the number of connection
$msec, the time with an accuracy to microseconds at the moment of the log entry
$pipe, "p" if request was pipelining
$request_length, the length of the body of the request
$request_time, the time of working on request in seconds
$status, status of answer
$time_local, local time into common log format.
The headers, transmitted to client, begin from the prefix "sent_http_", for example, $sent_http_content_range.

In the configuration there is always a predetermined format "combined":

log_format  combined  '$remote_addr - $remote_user [$time_local]  '
: '"$request" $status $apache_bytes_sent '
: '"$http_referer" "$http_user_agent"';
登入後複製

原始俄文文档:http://sysoev.ru/nginx/docs/http/ngx_http_log_module.html
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章

R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前 By 尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章標籤

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

tomcat伺服器怎麼能讓外網訪問 tomcat伺服器怎麼能讓外網訪問 Apr 21, 2024 am 07:22 AM

tomcat伺服器怎麼能讓外網訪問

nginx啟動指令和停止指令是什麼 nginx啟動指令和停止指令是什麼 Apr 02, 2024 pm 08:45 PM

nginx啟動指令和停止指令是什麼

thinkphp怎麼運行 thinkphp怎麼運行 Apr 09, 2024 pm 05:39 PM

thinkphp怎麼運行

抖音怎麼置頂自己視頻 抖音怎麼置頂自己視頻 Mar 26, 2024 pm 01:21 PM

抖音怎麼置頂自己視頻

Welcome to nginx!怎麼解決? Welcome to nginx!怎麼解決? Apr 17, 2024 am 05:12 AM

Welcome to nginx!怎麼解決?

phpmyadmin怎麼註冊 phpmyadmin怎麼註冊 Apr 07, 2024 pm 02:45 PM

phpmyadmin怎麼註冊

nodejs專案怎麼部署到伺服器 nodejs專案怎麼部署到伺服器 Apr 21, 2024 am 04:40 AM

nodejs專案怎麼部署到伺服器

造訪網站出現nginx怎麼解決 造訪網站出現nginx怎麼解決 Apr 02, 2024 pm 08:39 PM

造訪網站出現nginx怎麼解決

See all articles