title: Unable to make tomcat log basic 404 type error messages
body: <p><strong>I need the log where tomcat puts 404 type errors.
  I am using: tomcat 6 on Centos 5.2</strong></p>
  
  <p>I have been getting 404 errors in applications deployed on tomcat. I was unable to find the logs where tomcat puts messages when it is unable to find requested files and other simple errors.
  - I am not talking about stuff logged by applications, just 404 type stuff.</p>
  
  <p>I checked /logs and found following types of files</p>
  
  <ul>
  <li>catalina.out : contains startup and
  shutdown messages (mostly INFO
  messages)</li>
  <li>catalina..log : contains
  same data as above file for its date</li>
  <li>host-manager.year-mm-dd.log : empty
  (Seems to be meant for tomcat manger,
  I have not been using that)</li>
  <li>localhost.year-mm-dd.log : some
  application related log message
  (org.apache.catalina.core.ApplicationContext...
  INFO messages)</li>
  <li>manager.year-mm-dd.log : empty</li>
  </ul>
  
  <p>So, none of these contain the 404 errors. Since I installed tomcat by simply unpacking it in /usr/share I'm pretty sure it has no logs in /var/log (I checked and nothing for catlina or tomcat).</p>
  
  <p>I have tried, as also suggested by JoseK, to configure a valve in server.xml</p>
  
  <pre><code>&lt;Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
       prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/&gt;
  </code></pre>
  
  <p>This created the file /logs/localhost_access_log.txt which contains details of requests coming in e.g.</p>
  
  <pre><code>192.168.40.1 - - [23/Jul/2010:09:14:13 +0500] "GET /&lt;project url&gt;/files/file1.html HTTP/1.1" 404 1084
  </code></pre>
  
  <p>It contains request url: //files/file1.html
  I need the path of the file it couldn't find:  /usr/share...../files/file1.html
  JoseK has further suggested writing a custom valve for this, but it seems like too much work for a small requirement. Does anyone know a simpler way???</p>