Parcourir la source

ZF-10509: Using the functionality of priority to give meaning to the log in the default error controller

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@23535 44c647ce-9c0f-0410-b52a-842ac1e357ba
intiilapa il y a 15 ans
Parent
commit
b470c3c9a4
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      library/Zend/Tool/Project/Context/Zf/ControllerFile.php

+ 3 - 2
library/Zend/Tool/Project/Context/Zf/ControllerFile.php

@@ -143,21 +143,22 @@ switch (\$errors->type) {
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
-
         // 404 error -- controller or action not found
         \$this->getResponse()->setHttpResponseCode(404);
+        \$priority = Zend_Log::NOTICE;
         \$this->view->message = 'Page not found';
         break;
     default:
         // application error
         \$this->getResponse()->setHttpResponseCode(500);
+        \$priority = Zend_Log::CRIT;
         \$this->view->message = 'Application error';
         break;
 }
 
 // Log exception, if logger available
 if (\$log = \$this->getLog()) {
-    \$log->crit(\$this->view->message, \$errors->exception);
+    \$log->log(\$this->view->message, \$priority, \$errors->exception);
 }
 
 // conditionally display exceptions