Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access log #24

Open
splix opened this issue Jul 6, 2020 · 0 comments
Open

Access log #24

splix opened this issue Jul 6, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@splix
Copy link
Member

splix commented Jul 6, 2020

Produce a text based access log compatible with Apache Combined Log format:

Apache Combined Log format is:

%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"

See also: https://httpd.apache.org/docs/2.4/logs.html

For example

 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)" 

Standard (apache's) fields are:

  • %h The IP address of the client.
  • %l The identity of the client determined by identd on the client's machine. Will return a hyphen (-) if this information is not available.
  • %u The userid of the client if the request was authenticated.
  • %t The time that the request was received.
  • \"%r\" The request line that includes the HTTP method used, the requested resource path, and the HTTP protocol that the client used.
  • %>s The status code that the server sends back to the client.
  • %bThe size of the object requested.

Our changes:

  • %u is an serial number of the remote TLS certificate, if TLS auth was used
  • %r (request line) would contain blockchain + method, and type of the protocol may be HTTP/2+gRPC
  • %{Referer} is a particular request id + response index, i.e. for batched queries and streaming response

Log lines are added on response, and there could be multiple logs per one requests (batches, stream, etc).

Examples:

10.5.0.1 - 53f7446780fa803819da231f4068b25e [10/Jul/2020:13:55:36 +0000] "POST /ethereum/SubscribeBalance HTTP/2+gRPC" 200 2326 "a38ef37e4a53e852748b301370c710d7/5" "MyClient/1.0" 

Which means that:

  • a client from IP 10.5.0.1
  • authenticated with certificate 53:f7:44:67:80:fa:80:38:19:da:23:1f:40:68:b2:5e
  • using software MyClient/1.0
  • made request to subscribe balance on Ethereum blockchain
    • with original id a38ef37e4a53e852748b301370c710d7
    • and current line represent response number 5
  • uses gRPC protocol with HTTP2
  • request was successful and the current response was 2326 bytes
@splix splix added the enhancement New feature or request label Jul 6, 2020
@splix splix added this to the Milestone 0.9 milestone Jul 6, 2020
@splix splix modified the milestones: Milestone 0.9, Milestone 0.10 Sep 23, 2020
vdoflip pushed a commit to jit-strategies/dshackle that referenced this issue Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant