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

默认值: ​​access_log log/access.log combined​

自定义日志(末尾不要忘记分号):

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
log_format  combined  '$remote_addr - $remote_user [$time_local] '
: '"$request" $status $apache_bytes_sent '
: '"$http_referer" "$http_user_agent"';