Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Content Length in Request Log(NCSARequestLog)

Thanks Joakim for your reply.

I agree with your point, but with other web servers like Glassfish, Tomcat etc.when the access log is enabled they do log the content length even when the content length header is missing in web app response.

Is there is any workaround available?

--Jhony




On Tue, Nov 18, 2014 at 11:50 AM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Seeing as the logging on RequestLog occurs once the response is committed (in other words when response headers are sent), then the content-length in your scenario would likely be unset.

If you were to use a streaming response, with chunked encoding, or respond with partial content ranges, etc... then the Content Length would also be not be what you hope it would be.
Also, what would we log if the response contained a content-length value, but the response was terminated before the entire response content was finished being sent?

The logging of content length is what the response headers itself stated, not what was actually sent.


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Mon, Nov 17, 2014 at 11:29 AM, Jhony Jhony <oohjhony@xxxxxxxxx> wrote:
Hello Developers,

In my code to enable the access log I have added NCSARequestLog handler, which generates the request log with all the necessary information.

With respect to content length header I am getting this only if the web application set this header in part of their response.  If the web application does not set the content length header then it is missing in the request log.

Do I need to add some extra code to enable this or I am missing something else.

Thanks in advance for looking into this.

Yours,
Jhony

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top