-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Intellection/log_format_improvements
Log format improvements
- Loading branch information
Showing
2 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
log_format main '$remote_addr - $remote_user [$time_local] $status ' | ||
'"$request" $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for" $proxy_x_request_id'; | ||
log_format main_default escape=default | ||
'$remote_addr - $remote_user [$time_local] $status ' | ||
'"$request" $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for" $proxy_x_request_id'; | ||
|
||
access_log /dev/stdout main; | ||
log_format main_json escape=json | ||
'{' | ||
'"body_bytes_sent":"$body_bytes_sent",' | ||
'"host":"$host",' | ||
'"http_referrer":"$http_referer",' | ||
'"http_user_agent":"$http_user_agent",' | ||
'"http_x_forwarded_for":"$http_x_forwarded_for",' | ||
'"proxy_x_forwarded_port":"$proxy_x_forwarded_port",' | ||
'"proxy_x_forwarded_proto":"$proxy_x_forwarded_proto",' | ||
'"proxy_x_forwarded_ssl":"$proxy_x_forwarded_ssl",' | ||
'"proxy_x_request_id":"$proxy_x_request_id",' | ||
'"remote_addr":"$remote_addr",' | ||
'"remote_user":"$remote_user",' | ||
'"request":"$request",' | ||
'"request_length":"$request_length",' | ||
'"request_time":"$request_time",' | ||
'"status": "$status",' | ||
'"time_iso8601":"$time_iso8601"' | ||
'}'; | ||
|
||
access_log /dev/stdout main_json; | ||
error_log /dev/stdout warn; |