You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeff Kohut <je...@gmail.com> on 2015/02/13 16:28:56 UTC
Tomcat Access Logging Valve ?
I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1 platform.
I would like to control the contents of what gets logged to the Tomcat
localhost_access_log
specifically , I would like to remove logging of entries like :
10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0" 200 573
10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb HTTP/1.0" 200 561
we have some external load balancers and server monitoring software
periodically hitting the application web page to see if it is responding. I
would like to know how remove these entries to reduce the amount of "noise"
that is in the localhost_access_log log file, but allow other entries
(i.e. from OTHER IP addresses or with other functions like "POST" or other
strings like "HTTP/1.1"
I have examined the information at the below link (unfortunately there is
no example there with detail on what I am attempting to do).
http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
Seems like I want to use the valve Access Log Valve Attributes:
conditionIf
or
conditionUnless
options from valve documentation, but it is not clear to me how to do this
(if this is the correct way ?).
Server.xml currently has the following setup configuration:
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common"
-->
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
Is it possible to do this without programming (i.e. can I set the valve
components to simply filter on an ip address or key word string (i.e. "Get
/atb HTTP/1.0" and if that value is found in the request, can I chose to
then NOT write that entry to the AccessLogValve). I have searched pretty
thoroughly for some time on how to do this, but the documentation simply
does not provide enough of an example on how to do this. I am not a
programmer, but would think that filtering entries out of logs based on
criteria would be a valuable feature to have.
Any example would be greatly appreciated
Thanks
Jeff
Sent from Google Nexus Phone
Re: Tomcat Access Logging Valve ?
Posted by Jeff Kohut <je...@gmail.com>.
Sent from my tablet.
On Feb 17, 2015 7:22 AM, "Rainer Jung" <ra...@kippdata.de> wrote:
>
> Am 14.02.2015 um 18:44 schrieb Jeff Kohut:
>
>> Sent from Google Nexus Phone
>> On Feb 14, 2015 9:54 AM, "Rainer Jung" <ra...@kippdata.de> wrote:
>>>
>>>
>>> Am 14.02.2015 um 12:46 schrieb Jeff Kohut:
>>>
>>>> On Fri, Feb 13, 2015 at 10:29 AM, Christopher Schultz <
>>>> chris@christopherschultz.net> wrote:
>>>>
>>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>>> Hash: SHA256
>>>>>
>>>>> Jeff,
>>>>>
>>>>> On 2/13/15 10:28 AM, Jeff Kohut wrote:
>>>>>>
>>>>>>
>>>>>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
>>>>>> platform.
>>>>>>
>>>>>> I would like to control the contents of what gets logged to the
>>>>>> Tomcat localhost_access_log
>>>>>>
>>>>>> specifically , I would like to remove logging of entries like :
>>>>>>
>>>>>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0"
>>>>>> 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb
>>>>>> HTTP/1.0" 200 561
>>>>>>
>>>>>> we have some external load balancers and server monitoring
>>>>>> software periodically hitting the application web page to see if it
>>>>>> is responding. I would like to know how remove these entries to
>>>>>> reduce the amount of "noise" that is in the localhost_access_log
>>>>>> log file, but allow other entries (i.e. from OTHER IP addresses or
>>>>>> with other functions like "POST" or other strings like "HTTP/1.1"
>>>>>>
>>>>>> I have examined the information at the below link (unfortunately
>>>>>> there is no example there with detail on what I am attempting to
>>>>>> do).
>>>>>>
>>>>>> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
>>>>>>
>>>>>> Seems like I want to use the valve Access Log Valve Attributes:
>>>>>>
>>>>>> conditionIf
>>>>>>
>>>>>> or
>>>>>>
>>>>>> conditionUnless
>>>>>>
>>>>>> options from valve documentation, but it is not clear to me how to
>>>>>> do this (if this is the correct way ?).
>>>>>
>>>>>
>>>>>
>>>>> Yep, this is what you are looking for.
>>>>>
>>>>>> Server.xml currently has the following setup configuration:
>>>>>>
>>>>>> <!-- Access log processes all example. Documentation at:
>>>>>> /docs/config/valve.html Note: The pattern used is equivalent to
>>>>>> using pattern="common" --> <Valve
>>>>>> className="org.apache.catalina.valves.AccessLogValve"
>>>>>> directory="logs" prefix="localhost_access_log." suffix=".txt"
>>>>>> pattern="%h %l %u %t "%r" %s %b" />
>>>>>>
>>>>>> Is it possible to do this without programming (i.e. can I set the
>>>>>> valve components to simply filter on an ip address or key word
>>>>>> string (i.e. "Get /atb HTTP/1.0" and if that value is found in the
>>>>>> request, can I chose to then NOT write that entry to the
>>>>>> AccessLogValve). I have searched pretty thoroughly for some time on
>>>>>> how to do this, but the documentation simply does not provide
>>>>>> enough of an example on how to do this. I am not a programmer, but
>>>>>> would think that filtering entries out of logs based on criteria
>>>>>> would be a valuable feature to have.
>>>>>
>>>>>
>>>>>
>>>>> You have to have a way to set (or not) a request attribute in order to
>>>>> use conditionIf/conditionUnless. One way to do it without writing any
>>>>> of your own code is to use url-rewrite, which is more like
>>>>> url-do-whatever:
>>>>> http://tuckey.org/urlrewrite/
>>>>>
>>>>> You can configure that to set request attributes under certain
>>>>> criteria. Just have it set (or not) whatever attribute name you use
>>>>> for your conditional logging and you should be good to go.
>>>>>
>>>>> Hope that helps,
>>>>> - -chris
>>>>>
>>>>
>>>> Chris, Looks a bit complicated (but then I guess life is a bit
>>
>> complicated
>>>>
>>>> ;-) I was hoping for something built in. In looking at the explanation
>>
>> and
>>>>
>>>> a little at the support websites, it looks as if this is something to
>>>> rewrite what makes it to the actual webapps applications. I did not see
>>>> where it was used to be able to filter out the main tomcat access logs
>>
>> (i.e
>>>>
>>>> being able to control something so early as the Request and built in
>>
>> Tomcat
>>>>
>>>> logging), but I guess it may be possible to do that. I will look into
>>
>> this
>>>>
>>>> further if I have the time. As Andre pointed out in a follow up post, I
>>>> could just filter the access log into another file externally and do my
>>>> cleanup that way.
>>>> Thank you for taking the time to answer and provide something to look
>>
>> into
>>>>
>>>> further.
>>>
>>>
>>>
>>> I basically agree with André. And the URL rewrite filter is a nice and
>>
>> powerful tool that's useful to learn about, although it can't be easily
>> integrated into a webapp from the outside (not moving it into the webapp
>> itself).
>>>
>>>
>>> If it happens that between your load balancer and Tomcat there is
already
>>
>> an Apache web server and the forwarding from Apache to Tomcat is done by
>> mod_jk, then you can set Tomcat request attributes from mod_jk by using
>> JkSetEnv. You would use a RewriteRule probably with a RewriteCond to set
an
>> Apache environment variable for the requests that come from the LB, then
>> use JkEnvVar to forward that variable, then use the conditionUnless for
the
>> Tomcat access log valve to suppress those requests. Using a seconds
>> AccessLogValve with conditionIf would let you log those requests to a
>> second log file.
>>>
>>>
>>> I'm not saying that I would inject a new Apache/mod_jk into the picture
>>
>> just for that feature. But if it were already there ...
>>>
>>>
>>> Regards,
>>>
>>> Rainer
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>> All good thoughts, but no Apache. If it can't be done in Tomcat, I will
>> likely just live without.
>
>
> Triggered by another post today: Starting with Tomcat 8 there's the
RewriteValve:
>
> http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html
>
> And that is able to set request attributes via configuration. Look for
"ENV" and "environment variable" because the RewriteValve was modelled
after Apache httpd mod_rewrite, where the notion is environment variable.
In Servlet land this was interpreted by the valve as request attribute.
>
> Totally forgot about it.
>
>
> Regards,
>
> Rainer
Thanks for pointing out the option in Tomcat 8. I will look at it. I now
have few options. Thanks to all for ideas.
Jeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
Re: Tomcat Access Logging Valve ?
Posted by Rainer Jung <ra...@kippdata.de>.
Am 14.02.2015 um 18:44 schrieb Jeff Kohut:
> Sent from Google Nexus Phone
> On Feb 14, 2015 9:54 AM, "Rainer Jung" <ra...@kippdata.de> wrote:
>>
>> Am 14.02.2015 um 12:46 schrieb Jeff Kohut:
>>
>>> On Fri, Feb 13, 2015 at 10:29 AM, Christopher Schultz <
>>> chris@christopherschultz.net> wrote:
>>>
>>>> -----BEGIN PGP SIGNED MESSAGE-----
>>>> Hash: SHA256
>>>>
>>>> Jeff,
>>>>
>>>> On 2/13/15 10:28 AM, Jeff Kohut wrote:
>>>>>
>>>>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
>>>>> platform.
>>>>>
>>>>> I would like to control the contents of what gets logged to the
>>>>> Tomcat localhost_access_log
>>>>>
>>>>> specifically , I would like to remove logging of entries like :
>>>>>
>>>>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0"
>>>>> 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb
>>>>> HTTP/1.0" 200 561
>>>>>
>>>>> we have some external load balancers and server monitoring
>>>>> software periodically hitting the application web page to see if it
>>>>> is responding. I would like to know how remove these entries to
>>>>> reduce the amount of "noise" that is in the localhost_access_log
>>>>> log file, but allow other entries (i.e. from OTHER IP addresses or
>>>>> with other functions like "POST" or other strings like "HTTP/1.1"
>>>>>
>>>>> I have examined the information at the below link (unfortunately
>>>>> there is no example there with detail on what I am attempting to
>>>>> do).
>>>>>
>>>>> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
>>>>>
>>>>> Seems like I want to use the valve Access Log Valve Attributes:
>>>>>
>>>>> conditionIf
>>>>>
>>>>> or
>>>>>
>>>>> conditionUnless
>>>>>
>>>>> options from valve documentation, but it is not clear to me how to
>>>>> do this (if this is the correct way ?).
>>>>
>>>>
>>>> Yep, this is what you are looking for.
>>>>
>>>>> Server.xml currently has the following setup configuration:
>>>>>
>>>>> <!-- Access log processes all example. Documentation at:
>>>>> /docs/config/valve.html Note: The pattern used is equivalent to
>>>>> using pattern="common" --> <Valve
>>>>> className="org.apache.catalina.valves.AccessLogValve"
>>>>> directory="logs" prefix="localhost_access_log." suffix=".txt"
>>>>> pattern="%h %l %u %t "%r" %s %b" />
>>>>>
>>>>> Is it possible to do this without programming (i.e. can I set the
>>>>> valve components to simply filter on an ip address or key word
>>>>> string (i.e. "Get /atb HTTP/1.0" and if that value is found in the
>>>>> request, can I chose to then NOT write that entry to the
>>>>> AccessLogValve). I have searched pretty thoroughly for some time on
>>>>> how to do this, but the documentation simply does not provide
>>>>> enough of an example on how to do this. I am not a programmer, but
>>>>> would think that filtering entries out of logs based on criteria
>>>>> would be a valuable feature to have.
>>>>
>>>>
>>>> You have to have a way to set (or not) a request attribute in order to
>>>> use conditionIf/conditionUnless. One way to do it without writing any
>>>> of your own code is to use url-rewrite, which is more like
>>>> url-do-whatever:
>>>> http://tuckey.org/urlrewrite/
>>>>
>>>> You can configure that to set request attributes under certain
>>>> criteria. Just have it set (or not) whatever attribute name you use
>>>> for your conditional logging and you should be good to go.
>>>>
>>>> Hope that helps,
>>>> - -chris
>>>>
>>>
>>> Chris, Looks a bit complicated (but then I guess life is a bit
> complicated
>>> ;-) I was hoping for something built in. In looking at the explanation
> and
>>> a little at the support websites, it looks as if this is something to
>>> rewrite what makes it to the actual webapps applications. I did not see
>>> where it was used to be able to filter out the main tomcat access logs
> (i.e
>>> being able to control something so early as the Request and built in
> Tomcat
>>> logging), but I guess it may be possible to do that. I will look into
> this
>>> further if I have the time. As Andre pointed out in a follow up post, I
>>> could just filter the access log into another file externally and do my
>>> cleanup that way.
>>> Thank you for taking the time to answer and provide something to look
> into
>>> further.
>>
>>
>> I basically agree with André. And the URL rewrite filter is a nice and
> powerful tool that's useful to learn about, although it can't be easily
> integrated into a webapp from the outside (not moving it into the webapp
> itself).
>>
>> If it happens that between your load balancer and Tomcat there is already
> an Apache web server and the forwarding from Apache to Tomcat is done by
> mod_jk, then you can set Tomcat request attributes from mod_jk by using
> JkSetEnv. You would use a RewriteRule probably with a RewriteCond to set an
> Apache environment variable for the requests that come from the LB, then
> use JkEnvVar to forward that variable, then use the conditionUnless for the
> Tomcat access log valve to suppress those requests. Using a seconds
> AccessLogValve with conditionIf would let you log those requests to a
> second log file.
>>
>> I'm not saying that I would inject a new Apache/mod_jk into the picture
> just for that feature. But if it were already there ...
>>
>> Regards,
>>
>> Rainer
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> All good thoughts, but no Apache. If it can't be done in Tomcat, I will
> likely just live without.
Triggered by another post today: Starting with Tomcat 8 there's the
RewriteValve:
http://tomcat.apache.org/tomcat-8.0-doc/rewrite.html
And that is able to set request attributes via configuration. Look for
"ENV" and "environment variable" because the RewriteValve was modelled
after Apache httpd mod_rewrite, where the notion is environment
variable. In Servlet land this was interpreted by the valve as request
attribute.
Totally forgot about it.
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Access Logging Valve ?
Posted by Jeff Kohut <je...@gmail.com>.
Sent from Google Nexus Phone
On Feb 14, 2015 9:54 AM, "Rainer Jung" <ra...@kippdata.de> wrote:
>
> Am 14.02.2015 um 12:46 schrieb Jeff Kohut:
>
>> On Fri, Feb 13, 2015 at 10:29 AM, Christopher Schultz <
>> chris@christopherschultz.net> wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA256
>>>
>>> Jeff,
>>>
>>> On 2/13/15 10:28 AM, Jeff Kohut wrote:
>>>>
>>>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
>>>> platform.
>>>>
>>>> I would like to control the contents of what gets logged to the
>>>> Tomcat localhost_access_log
>>>>
>>>> specifically , I would like to remove logging of entries like :
>>>>
>>>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0"
>>>> 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb
>>>> HTTP/1.0" 200 561
>>>>
>>>> we have some external load balancers and server monitoring
>>>> software periodically hitting the application web page to see if it
>>>> is responding. I would like to know how remove these entries to
>>>> reduce the amount of "noise" that is in the localhost_access_log
>>>> log file, but allow other entries (i.e. from OTHER IP addresses or
>>>> with other functions like "POST" or other strings like "HTTP/1.1"
>>>>
>>>> I have examined the information at the below link (unfortunately
>>>> there is no example there with detail on what I am attempting to
>>>> do).
>>>>
>>>> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
>>>>
>>>> Seems like I want to use the valve Access Log Valve Attributes:
>>>>
>>>> conditionIf
>>>>
>>>> or
>>>>
>>>> conditionUnless
>>>>
>>>> options from valve documentation, but it is not clear to me how to
>>>> do this (if this is the correct way ?).
>>>
>>>
>>> Yep, this is what you are looking for.
>>>
>>>> Server.xml currently has the following setup configuration:
>>>>
>>>> <!-- Access log processes all example. Documentation at:
>>>> /docs/config/valve.html Note: The pattern used is equivalent to
>>>> using pattern="common" --> <Valve
>>>> className="org.apache.catalina.valves.AccessLogValve"
>>>> directory="logs" prefix="localhost_access_log." suffix=".txt"
>>>> pattern="%h %l %u %t "%r" %s %b" />
>>>>
>>>> Is it possible to do this without programming (i.e. can I set the
>>>> valve components to simply filter on an ip address or key word
>>>> string (i.e. "Get /atb HTTP/1.0" and if that value is found in the
>>>> request, can I chose to then NOT write that entry to the
>>>> AccessLogValve). I have searched pretty thoroughly for some time on
>>>> how to do this, but the documentation simply does not provide
>>>> enough of an example on how to do this. I am not a programmer, but
>>>> would think that filtering entries out of logs based on criteria
>>>> would be a valuable feature to have.
>>>
>>>
>>> You have to have a way to set (or not) a request attribute in order to
>>> use conditionIf/conditionUnless. One way to do it without writing any
>>> of your own code is to use url-rewrite, which is more like
>>> url-do-whatever:
>>> http://tuckey.org/urlrewrite/
>>>
>>> You can configure that to set request attributes under certain
>>> criteria. Just have it set (or not) whatever attribute name you use
>>> for your conditional logging and you should be good to go.
>>>
>>> Hope that helps,
>>> - -chris
>>>
>>
>> Chris, Looks a bit complicated (but then I guess life is a bit
complicated
>> ;-) I was hoping for something built in. In looking at the explanation
and
>> a little at the support websites, it looks as if this is something to
>> rewrite what makes it to the actual webapps applications. I did not see
>> where it was used to be able to filter out the main tomcat access logs
(i.e
>> being able to control something so early as the Request and built in
Tomcat
>> logging), but I guess it may be possible to do that. I will look into
this
>> further if I have the time. As Andre pointed out in a follow up post, I
>> could just filter the access log into another file externally and do my
>> cleanup that way.
>> Thank you for taking the time to answer and provide something to look
into
>> further.
>
>
> I basically agree with André. And the URL rewrite filter is a nice and
powerful tool that's useful to learn about, although it can't be easily
integrated into a webapp from the outside (not moving it into the webapp
itself).
>
> If it happens that between your load balancer and Tomcat there is already
an Apache web server and the forwarding from Apache to Tomcat is done by
mod_jk, then you can set Tomcat request attributes from mod_jk by using
JkSetEnv. You would use a RewriteRule probably with a RewriteCond to set an
Apache environment variable for the requests that come from the LB, then
use JkEnvVar to forward that variable, then use the conditionUnless for the
Tomcat access log valve to suppress those requests. Using a seconds
AccessLogValve with conditionIf would let you log those requests to a
second log file.
>
> I'm not saying that I would inject a new Apache/mod_jk into the picture
just for that feature. But if it were already there ...
>
> Regards,
>
> Rainer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
All good thoughts, but no Apache. If it can't be done in Tomcat, I will
likely just live without.
Thanks.
Re: Tomcat Access Logging Valve ?
Posted by Rainer Jung <ra...@kippdata.de>.
Am 14.02.2015 um 12:46 schrieb Jeff Kohut:
> On Fri, Feb 13, 2015 at 10:29 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Jeff,
>>
>> On 2/13/15 10:28 AM, Jeff Kohut wrote:
>>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
>>> platform.
>>>
>>> I would like to control the contents of what gets logged to the
>>> Tomcat localhost_access_log
>>>
>>> specifically , I would like to remove logging of entries like :
>>>
>>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0"
>>> 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb
>>> HTTP/1.0" 200 561
>>>
>>> we have some external load balancers and server monitoring
>>> software periodically hitting the application web page to see if it
>>> is responding. I would like to know how remove these entries to
>>> reduce the amount of "noise" that is in the localhost_access_log
>>> log file, but allow other entries (i.e. from OTHER IP addresses or
>>> with other functions like "POST" or other strings like "HTTP/1.1"
>>>
>>> I have examined the information at the below link (unfortunately
>>> there is no example there with detail on what I am attempting to
>>> do).
>>>
>>> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
>>>
>>> Seems like I want to use the valve Access Log Valve Attributes:
>>>
>>> conditionIf
>>>
>>> or
>>>
>>> conditionUnless
>>>
>>> options from valve documentation, but it is not clear to me how to
>>> do this (if this is the correct way ?).
>>
>> Yep, this is what you are looking for.
>>
>>> Server.xml currently has the following setup configuration:
>>>
>>> <!-- Access log processes all example. Documentation at:
>>> /docs/config/valve.html Note: The pattern used is equivalent to
>>> using pattern="common" --> <Valve
>>> className="org.apache.catalina.valves.AccessLogValve"
>>> directory="logs" prefix="localhost_access_log." suffix=".txt"
>>> pattern="%h %l %u %t "%r" %s %b" />
>>>
>>> Is it possible to do this without programming (i.e. can I set the
>>> valve components to simply filter on an ip address or key word
>>> string (i.e. "Get /atb HTTP/1.0" and if that value is found in the
>>> request, can I chose to then NOT write that entry to the
>>> AccessLogValve). I have searched pretty thoroughly for some time on
>>> how to do this, but the documentation simply does not provide
>>> enough of an example on how to do this. I am not a programmer, but
>>> would think that filtering entries out of logs based on criteria
>>> would be a valuable feature to have.
>>
>> You have to have a way to set (or not) a request attribute in order to
>> use conditionIf/conditionUnless. One way to do it without writing any
>> of your own code is to use url-rewrite, which is more like
>> url-do-whatever:
>> http://tuckey.org/urlrewrite/
>>
>> You can configure that to set request attributes under certain
>> criteria. Just have it set (or not) whatever attribute name you use
>> for your conditional logging and you should be good to go.
>>
>> Hope that helps,
>> - -chris
>>
>
> Chris, Looks a bit complicated (but then I guess life is a bit complicated
> ;-) I was hoping for something built in. In looking at the explanation and
> a little at the support websites, it looks as if this is something to
> rewrite what makes it to the actual webapps applications. I did not see
> where it was used to be able to filter out the main tomcat access logs (i.e
> being able to control something so early as the Request and built in Tomcat
> logging), but I guess it may be possible to do that. I will look into this
> further if I have the time. As Andre pointed out in a follow up post, I
> could just filter the access log into another file externally and do my
> cleanup that way.
> Thank you for taking the time to answer and provide something to look into
> further.
I basically agree with André. And the URL rewrite filter is a nice and
powerful tool that's useful to learn about, although it can't be easily
integrated into a webapp from the outside (not moving it into the webapp
itself).
If it happens that between your load balancer and Tomcat there is
already an Apache web server and the forwarding from Apache to Tomcat is
done by mod_jk, then you can set Tomcat request attributes from mod_jk
by using JkSetEnv. You would use a RewriteRule probably with a
RewriteCond to set an Apache environment variable for the requests that
come from the LB, then use JkEnvVar to forward that variable, then use
the conditionUnless for the Tomcat access log valve to suppress those
requests. Using a seconds AccessLogValve with conditionIf would let you
log those requests to a second log file.
I'm not saying that I would inject a new Apache/mod_jk into the picture
just for that feature. But if it were already there ...
Regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Access Logging Valve ?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Jeff,
On 2/14/15 6:46 AM, Jeff Kohut wrote:
> On Fri, Feb 13, 2015 at 10:29 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
> Jeff,
>
> On 2/13/15 10:28 AM, Jeff Kohut wrote:
>>>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
>>>> platform.
>>>>
>>>> I would like to control the contents of what gets logged to
>>>> the Tomcat localhost_access_log
>>>>
>>>> specifically , I would like to remove logging of entries like
>>>> :
>>>>
>>>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb
>>>> HTTP/1.0" 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08
>>>> -0600] "GET /atb HTTP/1.0" 200 561
>>>>
>>>> we have some external load balancers and server monitoring
>>>> software periodically hitting the application web page to see
>>>> if it is responding. I would like to know how remove these
>>>> entries to reduce the amount of "noise" that is in the
>>>> localhost_access_log log file, but allow other entries (i.e.
>>>> from OTHER IP addresses or with other functions like "POST"
>>>> or other strings like "HTTP/1.1"
>>>>
>>>> I have examined the information at the below link
>>>> (unfortunately there is no example there with detail on what
>>>> I am attempting to do).
>>>>
>>>> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
>>>>
>>>> Seems like I want to use the valve Access Log Valve
>>>> Attributes:
>>>>
>>>> conditionIf
>>>>
>>>> or
>>>>
>>>> conditionUnless
>>>>
>>>> options from valve documentation, but it is not clear to me
>>>> how to do this (if this is the correct way ?).
>
> Yep, this is what you are looking for.
>
>>>> Server.xml currently has the following setup configuration:
>>>>
>>>> <!-- Access log processes all example. Documentation at:
>>>> /docs/config/valve.html Note: The pattern used is equivalent
>>>> to using pattern="common" --> <Valve
>>>> className="org.apache.catalina.valves.AccessLogValve"
>>>> directory="logs" prefix="localhost_access_log."
>>>> suffix=".txt" pattern="%h %l %u %t "%r" %s %b" />
>>>>
>>>> Is it possible to do this without programming (i.e. can I set
>>>> the valve components to simply filter on an ip address or key
>>>> word string (i.e. "Get /atb HTTP/1.0" and if that value is
>>>> found in the request, can I chose to then NOT write that
>>>> entry to the AccessLogValve). I have searched pretty
>>>> thoroughly for some time on how to do this, but the
>>>> documentation simply does not provide enough of an example on
>>>> how to do this. I am not a programmer, but would think that
>>>> filtering entries out of logs based on criteria would be a
>>>> valuable feature to have.
>
> You have to have a way to set (or not) a request attribute in order
> to use conditionIf/conditionUnless. One way to do it without
> writing any of your own code is to use url-rewrite, which is more
> like url-do-whatever: http://tuckey.org/urlrewrite/
>
> You can configure that to set request attributes under certain
> criteria. Just have it set (or not) whatever attribute name you
> use for your conditional logging and you should be good to go.
>
> Hope that helps, -chris
>
>
>> Chris, Looks a bit complicated (but then I guess life is a bit
>> complicated ;-) I was hoping for something built in. In looking
>> at the explanation and a little at the support websites, it looks
>> as if this is something to rewrite what makes it to the actual
>> webapps applications.
It does both: AccessLogValve's "conditionIf/conditionUnless" consult
request attributes to decide if logging should be performed.
url-rewrite can inject request attributes given certain request
criteria (like resource URL, just like you asked) without writing any
code: it's just configuration of the latter to control the behavior of
the former.
>> I did not see where it was used to be able to filter out the main
>> tomcat access logs (i.e being able to control something so early
>> as the Request and built in Tomcat logging), but I guess it may
>> be possible to do that. I will look into this further if I have
>> the time. As Andre pointed out in a follow up post, I could just
>> filter the access log into another file externally and do my
>> cleanup that way.
Post-processing the log file is definitely the best option for a
high-volume site: you'll save all the processing time you are
"wasting" on deciding whether or not to log each request. Then again,
the act of logging itself has performance consequences...
Access logs are written *after* the request has completed, so if you
alter the request during processing, the post-execution log-writer can
decide whether or not to log the request even after Filter code runs.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
iQIcBAEBCAAGBQJU4f0QAAoJEBzwKT+lPKRYYyIQAI/UkR/oJ1fMh9BaWiFCe0QY
3qA9fZM4RXxc9fnGXqHmy26x9iCxx6lLcew8kZPfr3iWeqyP2nQihGBaxOHB+/ea
6BQuNQVifAqIuSX0IUgJG3FnbltBNNu8HY7/Mvu+jGbK4UvwzJy8zpLlgzI+hxjM
H5zcmUDZc/DKRxiEY+bsdUjn6G1Mn5kYIBrIFJl8FJGQHgCzlhABnqQe5+F4rUOJ
Iqlfd8A38rbvdjcOwOW5E078WC0FRuhe2dhRknN7d8CpaMtiR+IDVUIfo3XvXUcc
Ti5DQEjBil6y5MDeO9UDrnntXx0/cC3KTMCvm7fk0/RV8wOauLmrW/v/9QFielkj
iA+2FwsJgOENc9Z9Lc5srit4qJhI6clAxnTnsjDIJc9uh3Znr0xxvvWKx07C85X5
K+FtRGPmMsVl2u0r/4R+jqQxqKLp6EZ3B5w3qegRVZf8JzxMZUcIksr5WriiQe3a
dfCdFl9m1vxiJtDwGEwwOF/TottR59cW2t2is9IIQQdNQmxqcSzxs7HdA3x1QMR8
Ztteq3nhx96pDX4eX6AB0xOKnhxGaEtYY/Wzovtch+g5uOH6YX6VDnSNAt/r0OVQ
S0g/zxuJJkOnoJUqYdFFTFDXaZVvXDUKQ0daXal25YbZf8UFSeLCnMa6v6DCUFLa
2mZiFdacLO0i8/1W9nqQ
=xFUV
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Access Logging Valve ?
Posted by Jeff Kohut <je...@gmail.com>.
On Fri, Feb 13, 2015 at 10:29 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Jeff,
>
> On 2/13/15 10:28 AM, Jeff Kohut wrote:
> > I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
> > platform.
> >
> > I would like to control the contents of what gets logged to the
> > Tomcat localhost_access_log
> >
> > specifically , I would like to remove logging of entries like :
> >
> > 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0"
> > 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb
> > HTTP/1.0" 200 561
> >
> > we have some external load balancers and server monitoring
> > software periodically hitting the application web page to see if it
> > is responding. I would like to know how remove these entries to
> > reduce the amount of "noise" that is in the localhost_access_log
> > log file, but allow other entries (i.e. from OTHER IP addresses or
> > with other functions like "POST" or other strings like "HTTP/1.1"
> >
> > I have examined the information at the below link (unfortunately
> > there is no example there with detail on what I am attempting to
> > do).
> >
> > http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
> >
> > Seems like I want to use the valve Access Log Valve Attributes:
> >
> > conditionIf
> >
> > or
> >
> > conditionUnless
> >
> > options from valve documentation, but it is not clear to me how to
> > do this (if this is the correct way ?).
>
> Yep, this is what you are looking for.
>
> > Server.xml currently has the following setup configuration:
> >
> > <!-- Access log processes all example. Documentation at:
> > /docs/config/valve.html Note: The pattern used is equivalent to
> > using pattern="common" --> <Valve
> > className="org.apache.catalina.valves.AccessLogValve"
> > directory="logs" prefix="localhost_access_log." suffix=".txt"
> > pattern="%h %l %u %t "%r" %s %b" />
> >
> > Is it possible to do this without programming (i.e. can I set the
> > valve components to simply filter on an ip address or key word
> > string (i.e. "Get /atb HTTP/1.0" and if that value is found in the
> > request, can I chose to then NOT write that entry to the
> > AccessLogValve). I have searched pretty thoroughly for some time on
> > how to do this, but the documentation simply does not provide
> > enough of an example on how to do this. I am not a programmer, but
> > would think that filtering entries out of logs based on criteria
> > would be a valuable feature to have.
>
> You have to have a way to set (or not) a request attribute in order to
> use conditionIf/conditionUnless. One way to do it without writing any
> of your own code is to use url-rewrite, which is more like
> url-do-whatever:
> http://tuckey.org/urlrewrite/
>
> You can configure that to set request attributes under certain
> criteria. Just have it set (or not) whatever attribute name you use
> for your conditional logging and you should be good to go.
>
> Hope that helps,
> - -chris
>
Chris, Looks a bit complicated (but then I guess life is a bit complicated
;-) I was hoping for something built in. In looking at the explanation and
a little at the support websites, it looks as if this is something to
rewrite what makes it to the actual webapps applications. I did not see
where it was used to be able to filter out the main tomcat access logs (i.e
being able to control something so early as the Request and built in Tomcat
logging), but I guess it may be possible to do that. I will look into this
further if I have the time. As Andre pointed out in a follow up post, I
could just filter the access log into another file externally and do my
cleanup that way.
Thank you for taking the time to answer and provide something to look into
further.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJU3iZ0AAoJEBzwKT+lPKRYWwgQAJ5DbuAXSfLFsrEW28fO8o3s
> BaSlltKTATrxY1LqBHGl/6HHTxs9qedE2LWRfoF6532GtVBB8bhWkb4pu/UWmO5x
> mVCsfHPL3EOpAeCioXnavm17O+7+fs/dYiaXHqynLQlINUTTvUnMgXYciBtIsMGx
> O8NPRRSrL8LZu2jD6VC0z3ruvvfq3aXFhyvTaBQWxme1OuETmu1LudVt9CrHA1ZY
> e9Mj4QM3GoXcZJwDH/ZbTQJUymEgXQNj3tyLYqPT6FuMLOGHTDJ9ok9kKxyw461p
> 9a73H6HpDSCCG3zc/eAudW7YPkxyjM0zez/B0PrGrz28zp5nnrqgFWzHvAIzVD/W
> 8F0+GBrHebMBlQ9nU1SQChq2mveDJ38kIq7mdm8j4Ncl2Y8W3Umq6YUWSGh3MNmG
> EtX4KpXE2gT+k5JuCI1E3v+6B/jP+1cv4onjN6y7ZaYjd3fM4nAQWA5N9K/xmPaO
> qgj4obHTFM76iseit5KgkRihJNAsCLmiQVqQ9KsJUKZe16xMcTLcLh3SAZRW+f07
> JJmNiKipaHBpOhWwXH4ZN6CIfXOsx/MKn3o+FjQzodSkv6/6E3l2J4niemy7xIY7
> z+ywCKa2ij6mFYHnmmfJEBdZ+5r19ESLasJPP5OdpFHbczY3o0LamYkuXQ9fzENU
> 89hMIQXCyw7qCmlTfvCF
> =EZML
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Tomcat Access Logging Valve ?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Jeff,
On 2/13/15 10:28 AM, Jeff Kohut wrote:
> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1
> platform.
>
> I would like to control the contents of what gets logged to the
> Tomcat localhost_access_log
>
> specifically , I would like to remove logging of entries like :
>
> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0"
> 200 573 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb
> HTTP/1.0" 200 561
>
> we have some external load balancers and server monitoring
> software periodically hitting the application web page to see if it
> is responding. I would like to know how remove these entries to
> reduce the amount of "noise" that is in the localhost_access_log
> log file, but allow other entries (i.e. from OTHER IP addresses or
> with other functions like "POST" or other strings like "HTTP/1.1"
>
> I have examined the information at the below link (unfortunately
> there is no example there with detail on what I am attempting to
> do).
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html
>
> Seems like I want to use the valve Access Log Valve Attributes:
>
> conditionIf
>
> or
>
> conditionUnless
>
> options from valve documentation, but it is not clear to me how to
> do this (if this is the correct way ?).
Yep, this is what you are looking for.
> Server.xml currently has the following setup configuration:
>
> <!-- Access log processes all example. Documentation at:
> /docs/config/valve.html Note: The pattern used is equivalent to
> using pattern="common" --> <Valve
> className="org.apache.catalina.valves.AccessLogValve"
> directory="logs" prefix="localhost_access_log." suffix=".txt"
> pattern="%h %l %u %t "%r" %s %b" />
>
> Is it possible to do this without programming (i.e. can I set the
> valve components to simply filter on an ip address or key word
> string (i.e. "Get /atb HTTP/1.0" and if that value is found in the
> request, can I chose to then NOT write that entry to the
> AccessLogValve). I have searched pretty thoroughly for some time on
> how to do this, but the documentation simply does not provide
> enough of an example on how to do this. I am not a programmer, but
> would think that filtering entries out of logs based on criteria
> would be a valuable feature to have.
You have to have a way to set (or not) a request attribute in order to
use conditionIf/conditionUnless. One way to do it without writing any
of your own code is to use url-rewrite, which is more like
url-do-whatever:
http://tuckey.org/urlrewrite/
You can configure that to set request attributes under certain
criteria. Just have it set (or not) whatever attribute name you use
for your conditional logging and you should be good to go.
Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
iQIcBAEBCAAGBQJU3iZ0AAoJEBzwKT+lPKRYWwgQAJ5DbuAXSfLFsrEW28fO8o3s
BaSlltKTATrxY1LqBHGl/6HHTxs9qedE2LWRfoF6532GtVBB8bhWkb4pu/UWmO5x
mVCsfHPL3EOpAeCioXnavm17O+7+fs/dYiaXHqynLQlINUTTvUnMgXYciBtIsMGx
O8NPRRSrL8LZu2jD6VC0z3ruvvfq3aXFhyvTaBQWxme1OuETmu1LudVt9CrHA1ZY
e9Mj4QM3GoXcZJwDH/ZbTQJUymEgXQNj3tyLYqPT6FuMLOGHTDJ9ok9kKxyw461p
9a73H6HpDSCCG3zc/eAudW7YPkxyjM0zez/B0PrGrz28zp5nnrqgFWzHvAIzVD/W
8F0+GBrHebMBlQ9nU1SQChq2mveDJ38kIq7mdm8j4Ncl2Y8W3Umq6YUWSGh3MNmG
EtX4KpXE2gT+k5JuCI1E3v+6B/jP+1cv4onjN6y7ZaYjd3fM4nAQWA5N9K/xmPaO
qgj4obHTFM76iseit5KgkRihJNAsCLmiQVqQ9KsJUKZe16xMcTLcLh3SAZRW+f07
JJmNiKipaHBpOhWwXH4ZN6CIfXOsx/MKn3o+FjQzodSkv6/6E3l2J4niemy7xIY7
z+ywCKa2ij6mFYHnmmfJEBdZ+5r19ESLasJPP5OdpFHbczY3o0LamYkuXQ9fzENU
89hMIQXCyw7qCmlTfvCF
=EZML
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Access Logging Valve ?
Posted by André Warnier <aw...@ice-sa.com>.
Jeff Kohut wrote:
> On Sat, Feb 14, 2015 at 4:48 AM, André Warnier <aw...@ice-sa.com> wrote:
>
>> Jeff Kohut wrote:
>>
>>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1 platform.
>>>
>>> I would like to control the contents of what gets logged to the Tomcat
>>> localhost_access_log
>>>
>>> specifically , I would like to remove logging of entries like :
>>>
>>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0" 200 573
>>> 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb HTTP/1.0" 200 561
>>>
>>>
>> Naive question : why make it complicated and add overhead to your Tomcat
>> process in order to do that ?
>> Why not leaving the access log as it is, and use an external filtering
>> program as and when you need it ?
>> like
>> grep -v -e "^GET \/atb " access.log > clean_access.log
>> comes to mind..
>>
>> Or, if you have several patterns to filter out :
>> grep -v -f file_with_patterns access.log > clean_access.log
>>
>> In addition, one might argue that this leaves in existence at least one
>> version of the access log which is really accurate, if you ever need it.
>>
>> I will consider your suggestion, as it does not look like I may have the
>> option to do what I originally would have preferred to do with built in
>> Tomcat functionality. Sorry if my question seemed naive, but since Tomcat
>> had options to control what was written out to the access log file, I
>> thought it might also have some options to control if ANYTHING was written
>> to the access log for certain entries(and possible in the configuration
>> itself.I suppose if everyone was an expert, then there would be no need for
>> these mailing lists. Thank you for your time and response.
>>
Hi.
It was my question which was naive, not yours.
There may be cases where there are very valid reasons for doing this kind of thing in
Tomcat itself (such as : you do not always have the possibility to run things outside of
Tomcat, or to install them, or to support them, etc..).
But in this case, if it is really just about filtering out some log lines which you are
not interested in for your particular purpose, an external utility seemed to me the best
way to go, because :
- you do not have to spend time investigating whether this can be done in Tomcat
- you do not have to write and test any additional code, nor maintain it later (using a
Java and Tomcat expert to do so)
- running this outside of Tomcat, based on specialised utilities already developed and
hyper-optimised and hyper-tested, would probably be in aggregate 10 times faster, and use
10 times less memory and other resources
- changing what you filter, or in how many ways you filter the original data for various
purposes, would just require a change in some text file, and not require any Tomcat
parameter changes, nor a Tomcat stop/start e.g.
- it can be test-run whenever and as many times as you wish, on the same or different
logfiles, without any risk of losing data or disturbing your Tomcat production processes
in any way
And if this needs to be portable to platforms where you do not have things like grep or
sed, you can do the same with a little Perl script, which will do the same and more, and
just about as fast. If you need that, just ask.
P.S. My usual work is in the information retrieval, documentation and archival area.
Probably because of that, it always kind of bothers me deep down when a process is
introduced which drops available information right at the source (like your first idea
was, to just not write these lines to the logs). That is because in this way, that
information is irretrievably lost, and there is no way later to retrieve it if you made a
mistake or your change your mind about something.
In this case, it is probably an over-reaction. But think that these requests are real
requests, effectively made to Tomcat and effectively processed by Tomcat. So if you ever
need to know exactly at what your Tomcat is passing its time, you would be losing part of
the data allowing to find that out.
P.P.S.
And I am not either a Tomcat nor a Java expert. I just loiter on this forum because it is
fun, and there are often interesting people and interesting things going on here.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Access Logging Valve ?
Posted by Jeff Kohut <je...@gmail.com>.
On Sat, Feb 14, 2015 at 4:48 AM, André Warnier <aw...@ice-sa.com> wrote:
> Jeff Kohut wrote:
>
>> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1 platform.
>>
>> I would like to control the contents of what gets logged to the Tomcat
>> localhost_access_log
>>
>> specifically , I would like to remove logging of entries like :
>>
>> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0" 200 573
>> 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb HTTP/1.0" 200 561
>>
>>
> Naive question : why make it complicated and add overhead to your Tomcat
> process in order to do that ?
> Why not leaving the access log as it is, and use an external filtering
> program as and when you need it ?
> like
> grep -v -e "^GET \/atb " access.log > clean_access.log
> comes to mind..
>
> Or, if you have several patterns to filter out :
> grep -v -f file_with_patterns access.log > clean_access.log
>
> In addition, one might argue that this leaves in existence at least one
> version of the access log which is really accurate, if you ever need it.
>
> I will consider your suggestion, as it does not look like I may have the
> option to do what I originally would have preferred to do with built in
> Tomcat functionality. Sorry if my question seemed naive, but since Tomcat
> had options to control what was written out to the access log file, I
> thought it might also have some options to control if ANYTHING was written
> to the access log for certain entries(and possible in the configuration
> itself.I suppose if everyone was an expert, then there would be no need for
> these mailing lists. Thank you for your time and response.
>
Jeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Tomcat Access Logging Valve ?
Posted by André Warnier <aw...@ice-sa.com>.
Jeff Kohut wrote:
> I am running Tomcat 7.0.54 on a Windows 2008 R1 with SP1 platform.
>
> I would like to control the contents of what gets logged to the Tomcat
> localhost_access_log
>
> specifically , I would like to remove logging of entries like :
>
> 10.239.54.8 - - [13/Feb/2015:00:00:07 -0600] "GET /atb HTTP/1.0" 200 573
> 10.239.58.29 - - [13/Feb/2015:00:00:08 -0600] "GET /atb HTTP/1.0" 200 561
>
Naive question : why make it complicated and add overhead to your Tomcat process in order
to do that ?
Why not leaving the access log as it is, and use an external filtering program as and when
you need it ?
like
grep -v -e "^GET \/atb " access.log > clean_access.log
comes to mind..
Or, if you have several patterns to filter out :
grep -v -f file_with_patterns access.log > clean_access.log
In addition, one might argue that this leaves in existence at least one version of the
access log which is really accurate, if you ever need it.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org