You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Antonios Kogias <co...@hua.gr> on 2011/12/05 07:41:47 UTC

Tomcat 7 Valve not logging correct response size

Good morning,

   I'm using Tomcat 7.0.16 and a Valve in the server.xml file that uses 
the %B option to log the "Bytes sent, excluding HTTP headers" 
(http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html).

<Valve className="org.apache.catalina.valves.AccessLogValve" 
directory="logs"
                prefix="localhost_access_log." suffix=".txt"
                pattern="%H %p %m %D %s %B %a %t &quot;%r&quot;" 
resolveHosts="false"/>

This works correctly for small response size (up to 30-40 kB), but for 
bigger sizes it doesn't; it only writes zero as response size in the web 
access log (I have tested that with 100 kB and 1000 kB static files).

Any idea why is that happening and what can be done to overcome?

Antonios

PS. OS is MS Windows XP 32bit SP3

RE: Tomcat 7 Valve not logging correct response size

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Antonios Kogias [mailto:coyas@hua.gr] 
> Subject: Re: Tomcat 7 Valve not logging correct response size

> Files of 1k, 10k, 25k get logged correctly, but files greater than that 
> (50k, 75k, 100k, 1000k) are logged as size zero(0).

Are you getting chunked output, by any chance?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 Valve not logging correct response size

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/12/9 Antonios Kogias <co...@hua.gr>:
> On 12/5/2011 9:29 AM, Konstantin Kolinko wrote:
>>
>> 2011/12/5 Antonios Kogias<co...@hua.gr>:
>>>
>>> Good morning,
>>>
>>>  I'm using Tomcat 7.0.16 and a Valve in the server.xml file that uses the
>>> %B
>>> option to log the "Bytes sent, excluding HTTP headers"
>>> (http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html).
>>>
>>> <Valve className="org.apache.catalina.valves.AccessLogValve"
>>> directory="logs"
>>>               prefix="localhost_access_log." suffix=".txt"
>>>               pattern="%H %p %m %D %s %B %a %t&quot;%r&quot;"
>>>
>>> resolveHosts="false"/>
>>>
>>> This works correctly for small response size (up to 30-40 kB), but for
>>> bigger sizes it doesn't; it only writes zero as response size in the web
>>> access log (I have tested that with 100 kB and 1000 kB static files).
>>>
>>> Any idea why is that happening and what can be done to overcome?
>>>
>>> Antonios
>>>
>>> PS. OS is MS Windows XP 32bit SP3
>>
>> 1. What happens with 7.0.23?
>> 2. Are you sure that the file was delivered to the client? Was the
>> time taken to process the request greater than zero? Was ir response
>> 200 OK, or 304 Not modified? In the latter case the file is not sent,
>> because the clint already has a copy of it.
>> 3. What connectors are you using and what are their settings?
>>
>
>
> *1. What happens with 7.0.23?*
>
> I tried 7.0.23 with the same results.
>
> Files of 1k, 10k, 25k get logged correctly, but files greater than that
> (50k, 75k, 100k, 1000k) are logged as size zero(0).
>
> *2. Are you sure that the file was delivered to the client? Was the*
>
> *time taken to process the request greater than zero? Was ir response*
>
> *200 OK, or 304 Not modified? In the latter case the file is not sent,*
>
> *because the clint already has a copy of it.*
>
> The files were all correctly delivered to the client.
> The time taken to process the request (option %D) is greater than zero most
> of the time, with occasional zeroes.
> All responses are 200 OK.
>
> *3. What connectors are you using and what are their settings?*
> In the experiment I'm running, I'm using the following simple Connector
> (server.xml):
> <Connector
>
> port="8080"
>
> protocol="HTTP/1.1"
>
> connectionTimeout="20000"
>
> redirectPort="8443"
>
> maxThreads="1"
>
> acceptCount="1"
>
> maxConnections="1"
>
> maxKeepAliveRequests="1"
>
> />

Good.
(Though you are not saying what exactly connector you are using,
because the value of protocol="HTTP/1.1" autoselects between two
connector implementations.)

I was able to reproduce your issue, see
https://issues.apache.org/bugzilla/show_bug.cgi?id=52316

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 7 Valve not logging correct response size

Posted by Antonios Kogias <co...@hua.gr>.
On 12/5/2011 9:29 AM, Konstantin Kolinko wrote:
> 2011/12/5 Antonios Kogias<co...@hua.gr>:
>> Good morning,
>>
>>   I'm using Tomcat 7.0.16 and a Valve in the server.xml file that uses the %B
>> option to log the "Bytes sent, excluding HTTP headers"
>> (http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html).
>>
>> <Valve className="org.apache.catalina.valves.AccessLogValve"
>> directory="logs"
>>                prefix="localhost_access_log." suffix=".txt"
>>                pattern="%H %p %m %D %s %B %a %t&quot;%r&quot;"
>> resolveHosts="false"/>
>>
>> This works correctly for small response size (up to 30-40 kB), but for
>> bigger sizes it doesn't; it only writes zero as response size in the web
>> access log (I have tested that with 100 kB and 1000 kB static files).
>>
>> Any idea why is that happening and what can be done to overcome?
>>
>> Antonios
>>
>> PS. OS is MS Windows XP 32bit SP3
> 1. What happens with 7.0.23?
> 2. Are you sure that the file was delivered to the client? Was the
> time taken to process the request greater than zero? Was ir response
> 200 OK, or 304 Not modified? In the latter case the file is not sent,
> because the clint already has a copy of it.
> 3. What connectors are you using and what are their settings?
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


*1. What happens with 7.0.23?*

I tried 7.0.23 with the same results.

Files of 1k, 10k, 25k get logged correctly, but files greater than that 
(50k, 75k, 100k, 1000k) are logged as size zero(0).

*2. Are you sure that the file was delivered to the client? Was the*

*time taken to process the request greater than zero? Was ir response*

*200 OK, or 304 Not modified? In the latter case the file is not sent,*

*because the clint already has a copy of it.*

The files were all correctly delivered to the client.
The time taken to process the request (option %D) is greater than zero 
most of the time, with occasional zeroes.
All responses are 200 OK.

*3. What connectors are you using and what are their settings?*
In the experiment I'm running, I'm using the following simple Connector 
(server.xml):
<Connector

port="8080"

protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443"

maxThreads="1"

acceptCount="1"

maxConnections="1"

maxKeepAliveRequests="1"

/>

There are four different settings for the experiments:
maxThreads=1 acceptCount=1 ,maxConnections=2
maxThreads=1 acceptCount=100 ,maxConnections=101

maxThreads=100 acceptCount=1 ,maxConnections=101

maxThreads=100 acceptCount=100 ,maxConnections=200

However, the same behavior as described in (1) above consistently 
appears in any setting.


Re: Tomcat 7 Valve not logging correct response size

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/12/5 Antonios Kogias <co...@hua.gr>:
> Good morning,
>
>  I'm using Tomcat 7.0.16 and a Valve in the server.xml file that uses the %B
> option to log the "Bytes sent, excluding HTTP headers"
> (http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html).
>
> <Valve className="org.apache.catalina.valves.AccessLogValve"
> directory="logs"
>               prefix="localhost_access_log." suffix=".txt"
>               pattern="%H %p %m %D %s %B %a %t &quot;%r&quot;"
> resolveHosts="false"/>
>
> This works correctly for small response size (up to 30-40 kB), but for
> bigger sizes it doesn't; it only writes zero as response size in the web
> access log (I have tested that with 100 kB and 1000 kB static files).
>
> Any idea why is that happening and what can be done to overcome?
>
> Antonios
>
> PS. OS is MS Windows XP 32bit SP3

1. What happens with 7.0.23?
2. Are you sure that the file was delivered to the client? Was the
time taken to process the request greater than zero? Was ir response
200 OK, or 304 Not modified? In the latter case the file is not sent,
because the clint already has a copy of it.
3. What connectors are you using and what are their settings?

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org