Logger register shut down #5875

Merged
merged 3 commits into from Mar 7, 2014

Conversation

Projects
None yet
5 participants

Fatal runtime errors cause execution of the script to halt, so the registered error handler will not be called to log the error. This PR adds an option to the logger to register a shutdown function to fetch the last error. This error will be logged if it was a fatal runtime error (E_ERROR)

library/Zend/Log/Logger.php
+ *
+ * @link http://www.php.net/manual/function.register-shutdown-function.php
+ * @param Logger $logger
+ * @return boolean

@weierophinney weierophinney added this to the 2.3.0 milestone Mar 3, 2014

Bummer, travis fails this test... locally it works fine, when I added the display_errors off setting. Trying suppress error with @ now

+ * @param Logger $logger
+ * @return bool
+ */
+ public static function registerFatalErrorShutdownFunction(Logger $logger)
@Ocramius

Ocramius Mar 4, 2014

Member

Maybe a silly question, but is there a specific reason for this method to be on this class?

Contributor

jaapio commented Mar 7, 2014

@Ocramius for the same reason why the other methods like registerExceptionHandler and registerErrorHandler exist in this class. But it could be in any class like the other two.

@weierophinney weierophinney self-assigned this Mar 7, 2014

weierophinney added a commit that referenced this pull request Mar 7, 2014

Merge pull request #5875 from youngguns-nl/LoggerRegisterShutDown
Logger register shut down

Conflicts:
	library/Zend/Log/Logger.php

weierophinney added a commit that referenced this pull request Mar 7, 2014

@weierophinney weierophinney merged commit af3a04a into zendframework:develop Mar 7, 2014

1 check passed

default The Travis CI build passed
Details

@jaapio jaapio deleted the youngguns-nl:LoggerRegisterShutDown branch Mar 8, 2014

weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015

Merge pull request zendframework/zendframework#5875 from youngguns-nl…
…/LoggerRegisterShutDown

Logger register shut down

Conflicts:
	library/Zend/Log/Logger.php

weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment