Uncaught exception logging
This commit is contained in:
parent
bbf8bb0bb3
commit
2b6869bcea
|
@ -319,6 +319,7 @@ class OC{
|
|||
|
||||
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) {
|
||||
|
|
|
@ -48,6 +48,11 @@ class OC_Log {
|
|||
}
|
||||
}
|
||||
|
||||
// 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){
|
||||
self::write('PHP', $message . ' at ' . $file . '#' . $line, self::WARN);
|
||||
|
|
Loading…
Reference in New Issue