Uncaught exception logging
This commit is contained in:
parent
bbf8bb0bb3
commit
2b6869bcea
|
@ -317,8 +317,9 @@ class OC{
|
|||
|
||||
self::initPaths();
|
||||
|
||||
register_shutdown_function(array('OC_Log', 'onShutdown'));
|
||||
set_error_handler(array('OC_Log', 'onError' ));
|
||||
register_shutdown_function(array('OC_Log', 'onShutdown'));
|
||||
set_error_handler(array('OC_Log', 'onError'));
|
||||
set_exception_handler(array('OC_Log', 'onException'));
|
||||
|
||||
// set debug mode if an xdebug session is active
|
||||
if (!defined('DEBUG') || !DEBUG) {
|
||||
|
|
|
@ -47,6 +47,11 @@ class OC_Log {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Uncaught exception handler
|
||||
public static function onException($exception){
|
||||
self::write('PHP', $exception->getMessage() . ' at ' . $exception->getFile() . '#' . $exception->getLine(), self::FATAL);
|
||||
}
|
||||
|
||||
//Recoverable errors handler
|
||||
public static function onError($number, $message, $file, $line){
|
||||
|
|
Loading…
Reference in New Issue