Logging bytes received and sent from ASP.NET application

I am writing a logging component to my web application. Two things that
I have not been able to work out are how to get, in bytes, the size of
the request, and the size of the response.

I have seen that the IIS logs can output this information, however I
have not found a way to match this information with the rest of the
information that I am logging.

I also cannot see anything in the Request or Response classes that would
give me the information I need.

Could someone let me know where I might be able to find out how to
capture that information? Or, and this is less desirable but an
acceptable cludgy workaround, if there is any way to match up the IIS
logs entries with my own log?

Advertisements

Andy M wrote:
> Hi,
>
> I am writing a logging component to my web application. Two things that
> I have not been able to work out are how to get, in bytes, the size of
> the request, and the size of the response.
>
> I have seen that the IIS logs can output this information, however I
> have not found a way to match this information with the rest of the
> information that I am logging.
>
> I also cannot see anything in the Request or Response classes that would
> give me the information I need.
>
> Could someone let me know where I might be able to find out how to
> capture that information? Or, and this is less desirable but an
> acceptable cludgy workaround, if there is any way to match up the IIS
> logs entries with my own log?
>
> Cheers,
> Andy.

Does Request.ContentLength not give te desired information?
Don't know anything similar for Response.

Else you can take a look at HttpModules, I think that can give you all
the possibilities foor advanced logging.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!