question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logging: Include the bytes sent in request logging

See original GitHub issue

Describe your question: I would like to log the number of bytes sent when doing request logging.

I may have not found it, but having a snippet like

app.get("/", ctx -> ctx.result("test"));

returns a correct Content-Length response header. I was however unable to retrieve that information from the Context in the request logging lambda. Is there any trick that I am not seeing. grepping through the code I was also unable to see, where this was set, so I suppose it is set in jetty or some kotlin magic that evades my java eye.

Pointers appreciated 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
spinscalecommented, Jul 17, 2020

I left the content length out for now. The header itself is calculated deep in jetty, see https://github.com/eclipse/jetty.project/blob/jetty-10.0.x/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java#L785-L795

0reactions
tipsycommented, Jul 11, 2020

Have you found a solution to this @spinscale ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apache Logging Basics - The Ultimate Guide To Logging
The access log contains information about requests coming into the web server. ... This includes bytes received, sent, and transferred (combination of ...
Read more >
Size of "Bytes sent" in apache log file - Stack Overflow
I added to my apache log file another information-> %O which is indicated to bytes sent to user including headers.
Read more >
Logging Request/Response size in access_log of Nginx
$bytes_sent is total number of bytes sent to the client (as opposed to $body_sent which is compatible with apache %B).
Read more >
Access logs for your Application Load Balancer
Elastic Load Balancing provides access logs that capture detailed information about requests sent to your load balancer. Each log contains information such ...
Read more >
request-log-format - IBM
Logs raw query strings that the user must decode manually. First line of the request. First line of the request including HTTP://HOSTNAME. Status....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found