what you defined is correct ... a simpler way is using default setting <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="your-site-access-log-" suffix=".log" pattern="common" resolveHosts="false"/>
the result should be (if you are testing from same host) 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] "GET /site/ HTTP/1.1" 200 306 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] "GET /site/Welcome.do HTTP/1.1" 200 1775 (if your user testing from remote host) 202.110.6.23 - - [18/Oct/2006:19:03:44 +0800] "GET /site/Welcome.do HTTP/1.1" 200 8893 ... On 10/30/06, Rashmi Rubdi <[EMAIL PROTECTED]> wrote:
Hello, My site is hosted on Tomcat 5.5 and I'm trying to log the IP Address of search engine bots that crawl the site. After reading the following documentation here, which is written very nicely btw http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html I configured the pattern attribute of AccessLogValve as follows: <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%a %A %h %H %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"" prefix="localhost_access_log." resolveHosts="false" suffix=".txt" /> The following is a sample of what gets logged with the above configuration in server.xml . 127.0.0.1 68.120.115.43 127.0.0.1 HTTP/1.1 - [29/Oct/2006:23:50:13 -0800] "GET /web/_stylesheet/table.css HTTP/1.1" 304 - " http://www.website.com/c/a_page.jsp" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" The documentation says that %a is Remote IP Address, however 127.0.0.1 is being logged instead of the IP Address of the requestor. Is this correct? IMO %a should be the IP Address of the agent that's making the request - ( i.e. the IP Address of a browser or a bot etc). Please let me know if there's a way to log IP Address of the agent that's making the request. Any help is appreciated. -Thank you Rashmi --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- When we invent time, we invent death.