On Fri, 15 Nov 2002, Chris Campbell wrote:
> Date: Fri, 15 Nov 2002 15:15:20 +0900 > From: Chris Campbell <[EMAIL PROTECTED]> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]> > To: 'Tomcat Users List' <[EMAIL PROTECTED]> > Subject: Per context access logs (Standalone 4.1.12) > > > Hi, > I have a context set up as below, taken from server.xml. There are no errors > and the log file is created just fine, but the only accesses that ever get > recorded are accesses to the url "/". That is, no matter how many pages I > access, the log becomes filled with the same line like this: > > [15/Nov/2002:15:38:42 9000] "GET / HTTP/1.1" 302 - > [15/Nov/2002:15:44:18 9000] "GET / HTTP/1.1" 302 - > [15/Nov/2002:15:44:23 9000] "GET / HTTP/1.1" 302 - > > The 4.1 valve documentation says that valves can be added to servlet > containers and contexts, and that when an AccessLogValve is associated with > a container it will record ALL requests processed by that container. It does > not say what should happen when an AccessLogValve is associated with a > context, but I had assumed it would record all requests processed by that > context. So does anyone know if this is a case of 1) wrong configuration by > me, 2) docs forgot to mention something, or 3) missing implementation of > this in Tomcat. > Your understanding is correct. The log file configured by the <Valve> element in your example below will *only* log requests to the default webapp (i.e. the one that handles requests that could not be matched to any other defined context path). In order to understand the existence of the lines above, think about what happens when the user enters a URL like: http://www.mycompany.com:8080 (assuming you've got Tomcat running on port 8080). Tomcat will redirect (i.e. send status code 302) this request to: http://www.mycompany.com:8080/ which will end up trying to display your configured welcome file. > thanks, > ChrisC > Craig > > [server.xml] > > <Context path="/" docBase="ROOT" debug="0" > reloadable="true" > > <Valve className="org.apache.catalina.valves.AccessLogValve" > directory="logs" prefix="ROOT_access_log." suffix=".txt" > pattern="common" resolveHosts="true"/> > </Context> > > > > > > > > > > -- > To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> > For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org> > > -- To unsubscribe, e-mail: <mailto:tomcat-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>