use JSON log format
This commit is contained in:
parent
0ea1557402
commit
3116eedc0a
1 changed files with 13 additions and 3 deletions
16
nginx.tmpl
16
nginx.tmpl
|
|
@ -38,9 +38,19 @@ map $http_upgrade $proxy_connection {
|
|||
|
||||
gzip_types text/plain text/css application/javascript application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
log_format vhost '$host $remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent"';
|
||||
log_format vhost '{"time": "$time_iso8601", '
|
||||
'"host": "$host", '
|
||||
'"remote_addr": "$remote_addr", '
|
||||
'"remote_user": "$remote_user", '
|
||||
'"body_bytes_sent": "$body_bytes_sent", '
|
||||
'"request_time": "$request_time", '
|
||||
'"status": "$status", '
|
||||
'"request": "$request", '
|
||||
'"request_uri": "$uri", '
|
||||
'"request_method": "$request_method", '
|
||||
'"http_referrer": "$http_referer", '
|
||||
'"http_x_forwarded_for": "$http_x_forwarded_for", '
|
||||
'"http_user_agent": "$http_user_agent"}';
|
||||
|
||||
access_log off;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue