博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
详细解释:nginx中ChsHttpLogModule模块配置及各个参数含义
阅读量:5766 次
发布时间:2019-06-18

本文共 1815 字,大约阅读时间需要 6 分钟。

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"';
原始俄文文档:

转载于:https://www.cnblogs.com/jessonlv/archive/2012/10/09/4388061.html

你可能感兴趣的文章
excel进行矩阵计算
查看>>
基于Android平台的动态生成控件和动态改变控件位置的方法
查看>>
linux 死机分析
查看>>
BOM
查看>>
iOS: Block的循环引用
查看>>
mysql实战02 | 日志系统:一条SQL更新语句是如何执行的?
查看>>
ECC椭圆曲线详解(有具体实例)
查看>>
Linux常见命令(二)
查看>>
PyCharm切换解释器
查看>>
jmp far ptr s所对应的机器码
查看>>
css详解1
查看>>
MySQL类型转换
查看>>
HashSet HashMap 源码阅读笔记
查看>>
变量声明提升1
查看>>
轻量级的Java 开发框架 Spring
查看>>
JS之路——浏览器window对象
查看>>
Chrome教程(二)使用ChromeDevTools命令菜单运行命令
查看>>
数据结构及算法基础--快速排序(Quick Sort)(二)优化问题
查看>>
随笔2013/2/19
查看>>
Windows Phone的Silverlight Toolkit 安装及其使用
查看>>