|
1 | | -log_format main '$remote_addr - $remote_user [$time_local] $status ' |
2 | | - '"$request" $body_bytes_sent "$http_referer" ' |
3 | | - '"$http_user_agent" "$http_x_forwarded_for" $proxy_x_request_id'; |
| 1 | +log_format main_default escape=default |
| 2 | + '$remote_addr - $remote_user [$time_local] $status ' |
| 3 | + '"$request" $body_bytes_sent "$http_referer" ' |
| 4 | + '"$http_user_agent" "$http_x_forwarded_for" $proxy_x_request_id'; |
4 | 5 |
|
5 | | -access_log /dev/stdout main; |
| 6 | +log_format main_json escape=json |
| 7 | + '{' |
| 8 | + '"body_bytes_sent":"$body_bytes_sent",' |
| 9 | + '"host":"$host",' |
| 10 | + '"http_referrer":"$http_referer",' |
| 11 | + '"http_user_agent":"$http_user_agent",' |
| 12 | + '"http_x_forwarded_for":"$http_x_forwarded_for",' |
| 13 | + '"proxy_x_forwarded_port":"$proxy_x_forwarded_port",' |
| 14 | + '"proxy_x_forwarded_proto":"$proxy_x_forwarded_proto",' |
| 15 | + '"proxy_x_forwarded_ssl":"$proxy_x_forwarded_ssl",' |
| 16 | + '"proxy_x_request_id":"$proxy_x_request_id",' |
| 17 | + '"remote_addr":"$remote_addr",' |
| 18 | + '"remote_user":"$remote_user",' |
| 19 | + '"request":"$request",' |
| 20 | + '"request_length":"$request_length",' |
| 21 | + '"request_time":"$request_time",' |
| 22 | + '"status": "$status",' |
| 23 | + '"time_iso8601":"$time_iso8601"' |
| 24 | + '}'; |
| 25 | + |
| 26 | +access_log /dev/stdout main_json; |
6 | 27 | error_log /dev/stdout warn; |
0 commit comments