日志类型
- access.log
-
指令
logformat| Syntax: |**log_format**name[escape=default|json|none]string...;| | :—- | —- | | Default: | log_format combined “…”; | | Context: |http| | Desc: |
-escape参数(1.11.8)允许在变量中设置json或 默认字符转义,默认情况下,使用默认转义。none(1.13.10)禁用转义。
-string可以使用内置变量
|
ngx_http_log_module
access_log| Syntax: |**access_log**path[format[buffer=size] [gzip[=_level_]] [flush=time] [if=condition]];
or**access_log**off;| | :—- | —- | | Default: | access_log logs/access.log combined; | | Context: |http,server,location,if in location,limit_except| | Desc: |
- Sets the path, format, and configuration for a buffered log write.
- 可以在同一级别指定多个日志。
|
ngx_http_log_module
error_log| Syntax: |**error_log**file[level];| | :—- | —- | | Default: | error_log logs/error.log error; | | Context: |main,http,mail,stream,server,location|
ngx_core_module
日志可用变量
- 内置变量
- 包括 Http 请求变量
arg_<param>http_<header>sent_http_<header>
- 包括 Http 请求变量
- 自定义变量
