Look in the default install of tomcat in server.xml. There is an example of access log. Otherwise, the javadocs are most accurate. The syntax is just like apache (so assumptions were made to a certain knowledge bar).

Here is an example or two ..

Log only the ip addresses:
<Valve className="org.apache.catalina.valves.AccessLogValve"
       directory="logs"
          prefix="localhost_access_log."
          suffix=".txt"
         pattern="%a"/>

Log more stuff like request URL and time
<Valve className="org.apache.catalina.valves.AccessLogValve"
       directory="logs"
          prefix="localhost_access_log."
          suffix=".txt"
         pattern="%U %t"/>

You can also place in arbitrary text: (I think this should work)
<Valve className="org.apache.catalina.valves.AccessLogValve"
       directory="logs"
          prefix="localhost_access_log."
          suffix=".txt"
         pattern="The URL '%U' was hit on %t by %a !!!!"/>

-Tim

Paul Wallace wrote:
Great,
I checked out
/tomcat-4.1-doc/config/valve.html#Access%20Log%20Valve. An Access Log
Valve is what is needed here I think. I saw no reference to syntax
however, and to where the valve is placed? I wish to capture access to
ALL contexts, for a single engine. Where do I tell the server about the
valve? conf/web.xml? Syntax? Where might this information be located
please?


Thanks

Paul.


http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/logger.html http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html#Access %20Log%20Valve

-Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to