ZF-10444: Error logging


A really great security feature of the Zend_Amf is the proper error handling and the error message omission in the production mode, but when in production there might be some unexpected exceptions thrown by the very Zend Framework.

Usually, when the application is in production, there are users that do something wrong and suddenly for them "the application does not work" and end users are best known for their debugging capabilities (yeah right!).

Anyway, my proposal is to add a method on Zend_Amf_Server named "setExceptionLogger" which will go as follow:

//// Begin PHP code //// public function setExceptionLogger(Zend_Log $exceptionLogger) { $this->_exceptionLogger = $excpetionLogger; return $this; } //// End PHP code ////

and used inside method "_errorMessage" as follows:

//// Begin PHP code //// protected function _errorMessage($objectEncoding, $message, $description, $detail, $code, $line) { if($this->_exceptionLogger!==null){ $this->_exceptionLogger->log($message, Zend_Log::ERR); }


} //// End PHP code ////

This would help a lot in debugging applications, specially on production mode where we want to handle Exceptions without compromising the application.


No comments to display