Ngx_http_log_module:定义日志格式,并且以指定的格式保存
Syntax |
access_log path [format [buffer=size] [gzip[=level]] [flush=time] [if=condition]; access_log off; |
Default |
access_log logs/access.log combined; |
Context |
http, server, location, if in location, limit_except |
Syntax |
log_format name [escape=default|json] string …; |
Default |
log_format combined “…”; |
Context |
http |
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
access_log /spool/logs/nginx-access.log compres