my thoughts .....!

W3C logs in Tomcat

No comments

How to create logs in tomcat that would have http headers like user agent, referer, locat/remote server name or ip, request type, method and protocol ?

I Was searching for this and found to be in loop, the simple answer to achieve this is to edit your server.xml file and add/uncomment the below....

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  prefix="localhost_access_log." suffix=".txt" pattern="combined" resolveHosts="false"/>

To learn more check http://tomcat.apache.org/tomcat-5.0-doc/config/valve.html 

If you want only one Tomcat Context to generate this kind of logs, include the same in web.xml after you remove it from server.xml

Hope this helps you !, if you need any help - just contact me !


Written by muthuveerappan

Wednesday 02 November 2005 at 10:48 pm

Posted in Technology

No comments

You can comment / reply using Facebook form or Standalone form (no login required)

Facebook Form

Leave a Reply (Standalone form)

(optional field)
(optional field)
To prevent automated commentspam we require you to answer this silly question

Comment moderation is enabled on this site. This means that your comment will not be visible until it has been approved by an editor.

Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.