You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rizwan Merchant <ri...@sysconet.ca> on 2007/10/31 22:29:53 UTC

Access Valve

Hi,
I am trying to set up the access valve so that we can analyze our 
traffic using the softwares that are out there.
I noticed that when I turn on the access valve, it logs requests for 
every little item on the page, all the images etc. Is there a way I can 
have tomcat log only one line for every session? Or is there a way to 
exclude requests made for images and certain other types of files?

Thanks,
-Rizwan Merchant.


Re: Access Valve

Posted by Len Popp <le...@gmail.com>.
No, Chris was talking about the configuration of the AccessLogValve.
Read the documentation link he gave.

Alternatively, maybe you can just grep the log file for certain lines
that tell you what you need to know, for example "GET /index.jsp".
-- 
Len

On 10/31/07, Rizwan Merchant <ri...@sysconet.ca> wrote:
>
> Thanks Chris,
> Does that mean that I need to set the value of an attribute in my code,
> and check that value in the valve? That seems intrusive as I have to set
> up my code to handle this.
>
> Let me step back a little. Can you tell me..what if I leave it the way
> it is and let it log everything. Would this slow down the application
> since it will be doing a LOT of writing to the access log file? Or am I
> worrying too much about this?
> My main reason to log less is so that tomcat is not bogged down because
> of how much it is writing to the access log..
>
> Thanks,
> -Riz.
>
> Christopher Schultz wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Rizwan,
> >
> > Rizwan Merchant wrote:
> >
> >> Hi,
> >> I am trying to set up the access valve so that we can analyze our
> >> traffic using the softwares that are out there.
> >> I noticed that when I turn on the access valve, it logs requests for
> >> every little item on the page, all the images etc. Is there a way I can
> >> have tomcat log only one line for every session?
> >>
> >
> > One line for every session? Or one line for the first request processed
> > by a keepalive connection?
> >
> >
> >> Or is there a way to
> >> exclude requests made for images and certain other types of files?
> >>
> >
> > It looks like the only way to do either of these things is to use the
> > "condition" attribute of the valve. Check out the docs for that
> > attribute -- it might give you some ideas.
> >
> > http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
> >
> > - -chris
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.7 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> >
> > iD8DBQFHKPV+9CaO5/Lv0PARAg9UAKC6jZzhQ4+Mqj7ZiE4ln8RaQC9CYACggx1B
> > RMYXs+J0ZSoFYXdGKxZkU9A=
> > =xCzU
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: Access Valve

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rizwan,

Rizwan Merchant wrote:
> Does that mean that I need to set the value of an attribute in my code,
> and check that value in the valve? That seems intrusive as I have to set
> up my code to handle this.

Well, you could install a simple filter to add this attribute: you don't
have to modify your application's code.

> Let me step back a little. Can you tell me..what if I leave it the way
> it is and let it log everything. Would this slow down the application
> since it will be doing a LOT of writing to the access log file? Or am I
> worrying too much about this?

That depends. Are you observing a performance problem?

> My main reason to log less is so that tomcat is not bogged down because
> of how much it is writing to the access log..

As long as you're not suffering from premature optimization, turning
"down" the access filter will speed things up. Then again, logging is
fast when compared to something like database access. If you have a
relatively heavy application, logging isn't likely to be a big
performance problem.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKRCl9CaO5/Lv0PARAvrmAJsEDH33EfUhc1z/LIbTWX0E3lNPqACffeZn
ta/y7D1oionLW9PfZnBQ6MQ=
=u6dl
-----END PGP SIGNATURE-----

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


Re: Access Valve

Posted by Rizwan Merchant <ri...@sysconet.ca>.
Thanks Chris,
Does that mean that I need to set the value of an attribute in my code, 
and check that value in the valve? That seems intrusive as I have to set 
up my code to handle this.

Let me step back a little. Can you tell me..what if I leave it the way 
it is and let it log everything. Would this slow down the application 
since it will be doing a LOT of writing to the access log file? Or am I 
worrying too much about this?
My main reason to log less is so that tomcat is not bogged down because 
of how much it is writing to the access log..

Thanks,
-Riz.

Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Rizwan,
>
> Rizwan Merchant wrote:
>   
>> Hi,
>> I am trying to set up the access valve so that we can analyze our
>> traffic using the softwares that are out there.
>> I noticed that when I turn on the access valve, it logs requests for
>> every little item on the page, all the images etc. Is there a way I can
>> have tomcat log only one line for every session?
>>     
>
> One line for every session? Or one line for the first request processed
> by a keepalive connection?
>
>   
>> Or is there a way to
>> exclude requests made for images and certain other types of files?
>>     
>
> It looks like the only way to do either of these things is to use the
> "condition" attribute of the valve. Check out the docs for that
> attribute -- it might give you some ideas.
>
> http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHKPV+9CaO5/Lv0PARAg9UAKC6jZzhQ4+Mqj7ZiE4ln8RaQC9CYACggx1B
> RMYXs+J0ZSoFYXdGKxZkU9A=
> =xCzU
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


Re: Access Valve

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rizwan,

Rizwan Merchant wrote:
> 
> Hi,
> I am trying to set up the access valve so that we can analyze our
> traffic using the softwares that are out there.
> I noticed that when I turn on the access valve, it logs requests for
> every little item on the page, all the images etc. Is there a way I can
> have tomcat log only one line for every session?

One line for every session? Or one line for the first request processed
by a keepalive connection?

> Or is there a way to
> exclude requests made for images and certain other types of files?

It looks like the only way to do either of these things is to use the
"condition" attribute of the valve. Check out the docs for that
attribute -- it might give you some ideas.

http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKPV+9CaO5/Lv0PARAg9UAKC6jZzhQ4+Mqj7ZiE4ln8RaQC9CYACggx1B
RMYXs+J0ZSoFYXdGKxZkU9A=
=xCzU
-----END PGP SIGNATURE-----

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