Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.19.5-4

* Renamed `main` logging format to `main_default`.
* Remove unnecessary double space between `$time_local` & `$status` from
`main_default` logging format.
* Add `main_json` logging format and configure it on `access_log`.

## 1.19.5-3

* Set or forward `X-Request-ID`.
Expand Down
29 changes: 25 additions & 4 deletions config/log.conf
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;