-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Felix,
On 9/16/13 10:25 AM, Felix Schumacher wrote: > Am Montag, den 16.09.2013, 10:02 -0400 schrieb Christopher > Schultz: >> Jim, >> >> On 9/16/13 3:42 AM, Jim Barber wrote: >>> I'm hoping someone on this list can help me since I've been >>> reading docs, mailing lists, FAQs, and so on for hours now, and >>> I'm not having much luck finding an answer to my question. >>> >>> I am using Tomcat version 7.0.42 as packaged in Debian Linux. >>> In front of my Tomcat servers, I am using haproxy for load >>> balancing. The haproxy load balancers are using the HTTP >>> OPTIONS request method to check if the Tomcat servers are alive >>> and healthy. >>> >>> This results in log entries like the following in the Tomcat >>> accesslog file: >>> >>> 10.122.32.4 - - [16/Sep/2013:17:12:49 +1000] "OPTIONS / >>> HTTP/1.0" 200 - 10.122.32.4 - - [16/Sep/2013:17:12:51 +1000] >>> "OPTIONS / HTTP/1.0" 200 - 10.122.32.4 - - >>> [16/Sep/2013:17:12:53 +1000] "OPTIONS / HTTP/1.0" 200 - >>> 10.122.32.4 - - [16/Sep/2013:17:12:55 +1000] "OPTIONS / >>> HTTP/1.0" 200 - 10.122.32.4 - - [16/Sep/2013:17:12:57 +1000] >>> "OPTIONS / HTTP/1.0" 200 - 10.122.32.4 - - >>> [16/Sep/2013:17:12:59 +1000] "OPTIONS / HTTP/1.0" 200 - >>> 10.122.32.4 - - [16/Sep/2013:17:13:01 +1000] "OPTIONS / >>> HTTP/1.0" 200 - 10.122.32.4 - - [16/Sep/2013:17:13:03 +1000] >>> "OPTIONS / HTTP/1.0" 200 - 10.122.32.4 - - >>> [16/Sep/2013:17:13:05 +1000] "OPTIONS / HTTP/1.0" 200 - >>> 10.122.32.4 - - [16/Sep/2013:17:13:07 +1000] "OPTIONS / >>> HTTP/1.0" 200 - 10.122.32.4 - - [16/Sep/2013:17:13:09 +1000] >>> "OPTIONS / HTTP/1.0" 200 - 10.122.32.4 - - >>> [16/Sep/2013:17:13:11 +1000] "OPTIONS / HTTP/1.0" 200 - >>> >>> At the moment I'm getting one of these every 2seconds, but I >>> haven't enabled the second load balancer for HA purposes yet. >>> When I do that, I'll be getting twice as many hits of this >>> type. >>> >>> This is going to result in rather large log files full of >>> noise that I'm not interested in. >> >> Playing the devil's advocate here a bit... >> >> Why wouldn't you be interested in getting these logs? They are >> requests being handled by your web server. They require (a small >> amount of) time and resources to process, and indicate that your >> lb is still reaching-out to determine the status of the app >> server. >> >> My recommendation would be to leave those logs in there (they >> accurately describe a real request) and filter them out if you >> want to do some kind of analytics against your log files and >> consider those OPTIONS requests to be noise. > I have had one case where I wanted to get rid of those requests > too, so I can understand the OP. But I have to admint I had a scary > feeling about it. > >> >>> <Valve className="org.apache.catalina.valves.AccessLogValve" >>> directory="logs" prefix="localhost_access_log." suffix=".txt" >>> pattern="%h %l %u %t "%r" %s %b" /> >>> >>> Specifically adding the condition="<VALUE>" attribute, but I >>> have no idea what to set <VALUE> to. >> >> It's not that simple: if you want to use "condition", then you >> have a write a Valve (can't be a Filter, since it must run >> *before* the AccessLogValve) that tests the request and sets a >> request attribute that will then trigger this condition. > > That is not true, you can use a filter, since the logging will > happen *after* the request and can and will check the request > attribute then. Thanks for pointing that out. After I had sent my message, I realized that and decided not to post a followup after reading yours. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJSNxs2AAoJEBzwKT+lPKRYJlIQAIZmTn6OA6aeNuENOAbXiXYs U+RrWYN4HKIStoVY50Z+2x5r/5ji7j/Juqlyas649Onn05mr3p4stOhzXJXXq9v4 +jeCJLm7VK19tIB12HmjMoTKdf6GapimC0X/WQcEVXVPU2i7R9NAsltcAJGkx4cA mmpCR/y15B4qt41UgteiIEV+8G7GGka1Zqr+J9qu/HWpAg0MWtWuVdggBjOYNRA/ RPGc2Ya3UUokaj4UAodyyQlOU4fWBXUb56w3MRlZ3z0ueA3noHT+2m8xTeAhHKrj sYJR7bDUFkFM2z8xN3+AIcAWE5wM/AA+shuXGQDtKGvxd88rOIQhFJOFHr8h2Mkl PIdxPcGGoj2Cn5RUkOdauhzc0TuwS7+e0zpXGJiTXdKQ0VjjPupqkde6z1v/q4IS swzKBOPYf5xlhhEaI1hm7SvjTTulNfwT428nWMFlu3Z/9nXdkLQFcbKs3LRzYT0I K6Y4GKX89IGCNbv3nplRQayHWYphtHEQ2eKB005hWo9Lw9IEduGMKdBX8fwcFrAL IR3tSQoM6JaVfi2q0S6x4U/bk1asSc4FpD6UPjA4FXDHZ1cTyH7+j8IF/J5fzqlq AxBXDSeA82CFtz+9hqc45F5ifQv6FSDR5JI1NZckYcKzXkHvtLmOyA4EP0BuiG6p Pe7DPMTkGK3G46/9zaym =Ggr6 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org