Skip to content

Conversation

itskingori
Copy link
Member

@itskingori itskingori commented Feb 22, 2021

Title says it all. See commits for details, each commit is an idea.

@itskingori itskingori requested a review from a team as a code owner February 22, 2021 17:04
Copy link
Member Author

@itskingori itskingori left a comment

Choose a reason for hiding this comment

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

Some commentary ... 💬

'"host":"$host",'
'"http_connection":"$http_connection",'
'"http_referrer":"$http_referer",'
'"http_referer":"$http_referer",'
Copy link
Member Author

Choose a reason for hiding this comment

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

From the HTTP referer Wikipedia page ...

The misspelling of referrer was introduced in the original proposal by computer scientist Phillip Hallam-Baker to incorporate the field into the HTTP specification. The misspelling was set in stone by the time of its incorporation into the Request for Comments standards document RFC 1945; document co-author Roy Fielding has remarked that neither "referrer" nor the misspelling "referer" were recognized by the standard Unix spell checker of the period.

'{'
'"body_bytes_sent":"$body_bytes_sent",'
'"host":"$host",'
'"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"
}

@itskingori itskingori force-pushed the update_and_fix_logged_information branch from 49e5647 to 8fbeba3 Compare February 22, 2021 22:01
@itskingori itskingori changed the title Log connection header and fix "incorrect" spelling of referer header Update and fix information logged in the JSON format Feb 22, 2021
'"http_connection":"$http_connection",'
'"http_referer":"$http_referer",'
'"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).

Copy link

@hadrianvalentine hadrianvalentine left a comment

Choose a reason for hiding this comment

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

LGTM 👍

'"host":"$host",'
'"http_referrer":"$http_referer",'
'"http_connection":"$http_connection",'
'"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.

@itskingori itskingori merged commit 245184f into master Feb 23, 2021
@itskingori itskingori deleted the update_and_fix_logged_information branch February 23, 2021 11:03
Copy link
Member

@zacblazic zacblazic left a comment

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants