How to log size of cookies in request header with apache

Posted by chrisst on Server Fault See other posts from Server Fault or by chrisst
Published on 2013-10-28T22:23:37Z Indexed on 2013/10/29 9:57 UTC
Read the original article Hit count: 219

Filed under:
|

We have an issue on our site with cookies growing too large. We have already expanded the acceptable header size and throttled the cookie sizes for now, but I'd like to figure out what the average client's header sizes are, specifically of the cookies.

I've created an apache log that captures the cookies being set on each request:

LogFormat "%{Cookie}i" cookies

But this just spits out the entire contents of all cookies in the header.

Is there a way to have apache just log the size (or just length of the string) per request?

© Server Fault or respective owner

Related posts about apache2

Related posts about logging