title: CakePHP 2 MissingControllerException in error.log => show accessed url
body: <p>Is it possible to create/extend a CakePHP Exception handler which shows the url the user tried to access which throws the exception?</p>
  
  <p>Usually when I look into my error.log file I see something like this:</p>
  
  <blockquote>
    <p>2012-08-01 13:39:20 Error: [MissingControllerException] Controller class UserController could not be found.
     #0 /www/htdocs/w0081e0e/app/webroot/index.php(104): Dispatcher->dispatch(Object(CakeRequest),  Object(CakeResponse))
     #1 {main}</p>
  </blockquote>
  
  <p>I have a working UsersController but I'm not sure which url the user tried to access which in return throw this error. It would help me to see the url in the error.log file. Is that possible? Would I have to create/extend an exception handling file?</p>
  
  <hr>
  
  <p><strong>Update:</strong>
  Instead of writing my own ExceptionHandler I just updated the "handleException" function in "lib/Cake/Error/ErrorHandler.php":</p>
  
  <pre><code>if (!empty($config['log'])) {
          $message = sprintf("[%s] %s\n%s",
              get_class($exception),
              $exception-&gt;getMessage(),
              $exception-&gt;getTraceAsString().' - http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']."\n"
          );
          CakeLog::write(LOG_ERR, $message);
      }
  </code></pre>
  
  <p>I know that this is overwritten once I update my CakePHP Version but its a quick fix that works really fine for my situation.</p>