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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.19.5-5

* Add `http_x_amzn_trace_id` to json logging (for `X-Amzn-Trace-Id` header).
* Add `http_connection` to json logging (for `Connection` header).
* Fix "incorrect" spelling of header.

## 1.19.5-4

* Renamed `main` logging format to `main_default`.
Expand Down
4 changes: 3 additions & 1 deletion config/log.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ log_format main_json escape=json
'{'
'"body_bytes_sent":"$body_bytes_sent",'
'"host":"$host",'
'"http_referrer":"$http_referer",'
'"http_connection":"$http_connection",'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it would be nice to see what the value of the Connection header is set to. Currently there's no way to see what it is. I also thought of the adding one for the protocol version but we can get that from the request attribute who's value includes the protocol i.e. GET / HTTP/1.1 as shown below.

{
  "body_bytes_sent": "1253",
  "host": "test.example.com",
  "http_referrer": "",
  "http_user_agent": "Mozilla/5.0 (apple-x86_64-darwin20.1.0) Siege/4.0.7",
  "http_x_forwarded_for": "105.163.39.239",
  "proxy_x_forwarded_port": "443",
  "proxy_x_forwarded_proto": "https",
  "proxy_x_forwarded_ssl": "on",
  "proxy_x_request_id": "eaec9ce4b52e915d59248fa2de3aa301",
  "remote_addr": "10.23.72.250",
  "remote_user": "",
  "request": "GET / HTTP/1.1",
  "request_length": "313",
  "request_time": "0.002",
  "status": "200",
  "time_iso8601": "2021-02-19T10:26:08+00:00"
}

'"http_referer":"$http_referer",'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note on the misspelling is interesting.

'"http_user_agent":"$http_user_agent",'
'"http_x_amzn_trace_id":"$http_x_amzn_trace_id",'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, one can correlate the X-Request-Id with the X-Amzn-Trace-Id (if it exists).

'"http_x_forwarded_for":"$http_x_forwarded_for",'
'"proxy_x_forwarded_port":"$proxy_x_forwarded_port",'
'"proxy_x_forwarded_proto":"$proxy_x_forwarded_proto",'
Expand Down