ZendFrameWork2
実現したいこと
1)error log出力を行いたい
2)1ができたら、次にLogに、stackTraceを出力したい
application/constrollers/ErrorController.php
php
1 public function errorAction() 2 { 3 $errors = $this->_getParam('error_handler'); 4 switch ($errors->type) { 5 case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: 6 case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: 7 case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: 8 $this->getResponse()->setHttpResponseCode(404); 9 $priority = Zend_Log::NOTICE; 10 $this->view->message = 'Page not found'; 11 break; 12 default: 13 $this->getResponse()->setHttpResponseCode(500); 14 $priority = Zend_Log::CRIT; 15 $this->view->message = 'Application error'; 16 break; 17 } 18 } 19
あなたの回答
tips
プレビュー