Is there option to log response content length?

Hi,
I am using Tyk gateway version 2.3, dashboard v.1.3.7 and pump v0.3. Is there a way to log content length for response? In csv log generated by pump I see content length field but it’s always 0 (zero).

Thanks!

I’m not sure if it is possible without enabling detailed logging https://www.tyk.io/docs/analyse/useful-debug-modes/

But be aware that detailed logging will increase amount of transferred data.

Leon, Tyk Team

Hi Leon,

Enabling detailed login stores full request and response but it don’t store content length (in my case), content length column is always 0. Here is sample data that is being stored. I wanted to know if we can store output content length or not.

Method,Path,RawPath,ContentLength,UserAgent,Day,Month,Year,Hour,ResponseCode,APIKey,TimeStamp,APIVersion,APIName,APIID,OrgID,OauthID,RequestTime,RawRequest,RawResponse,IPAddress,Geo,Tags,Alias,TrackPath,ExpireAt GET,/ip,/ip,0,"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36",12,July,2017,7,200,00000000,2017-07-12 07:16:43.927602069 +0000 UTC,Non Versioned,ssss,12c1369ef3eb442765b1fe8e872245ee,595ce037bf3eed0055ec7231,,996,some-value,some value,172.17.0.1,<analytics.GeoData Value>,key-00000000;org-595ce037bf3eed0055ec7231;api-12c1369ef3eb442765b1fe8e872245ee,,<bool Value>,2117-06-18 07:16:43.927931882 +0000 UTC

I see. I confused you a bit. ContentLength which sent to analytics is a “request” content length, not response one. But you have raw response object, so it should be possible to just compute its length instead.