瀏覽代碼

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 15 年之前
父節點
當前提交
b470c3c9a4
共有 1 個文件被更改,包括 3 次插入2 次删除
  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_ROUTE:
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
     case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
-
         // 404 error -- controller or action not found
         // 404 error -- controller or action not found
         \$this->getResponse()->setHttpResponseCode(404);
         \$this->getResponse()->setHttpResponseCode(404);
+        \$priority = Zend_Log::NOTICE;
         \$this->view->message = 'Page not found';
         \$this->view->message = 'Page not found';
         break;
         break;
     default:
     default:
         // application error
         // application error
         \$this->getResponse()->setHttpResponseCode(500);
         \$this->getResponse()->setHttpResponseCode(500);
+        \$priority = Zend_Log::CRIT;
         \$this->view->message = 'Application error';
         \$this->view->message = 'Application error';
         break;
         break;
 }
 }
 
 
 // Log exception, if logger available
 // Log exception, if logger available
 if (\$log = \$this->getLog()) {
 if (\$log = \$this->getLog()) {
-    \$log->crit(\$this->view->message, \$errors->exception);
+    \$log->log(\$this->view->message, \$priority, \$errors->exception);
 }
 }
 
 
 // conditionally display exceptions
 // conditionally display exceptions