function _mongodb_watchdog_enhance_log_entry in MongoDB 6
Same name and namespace in other branches
- 8 mongodb_watchdog/mongodb_watchdog.module \_mongodb_watchdog_enhance_log_entry()
- 7 mongodb_watchdog/mongodb_watchdog.module \_mongodb_watchdog_enhance_log_entry()
Fill in the log_entry function, file, and line.
Parameters
array $log_entry: A log entry in array form.
array $backtrace: A stack trace from debug_backtrace().
1 call to _mongodb_watchdog_enhance_log_entry()
- mongodb_watchdog_watchdog in mongodb_watchdog/
mongodb_watchdog.module - Implements hook_watchdog().
File
- mongodb_watchdog/
mongodb_watchdog.module, line 150
Code
function _mongodb_watchdog_enhance_log_entry(array &$log_entry, array $backtrace) {
// Create list of functions to ignore in backtrace.
static $ignore = array(
'mongodb_watchdog_watchdog' => 1,
'call_user_func_array' => 1,
'module_invoke' => 1,
'watchdog' => 1,
'_drupal_log_error' => 1,
'_drupal_error_handler' => 1,
'_drupal_error_handler_real' => 1,
'theme_render_template' => 1,
);
foreach ($backtrace as $bt) {
if (isset($bt['function'])) {
if (isset($bt['line']) && !isset($ignore[$bt['function']])) {
if (isset($bt['file'])) {
$log_entry['file'] = $bt['file'];
}
$log_entry['function'] = $bt['function'];
$log_entry['line'] = $bt['line'];
break;
}
elseif ($bt['function'] == '_drupal_exception_handler') {
$e = $bt['args'][0];
_mongodb_watchdog_enhance_log_entry($log_entry, $e
->getTrace());
}
}
}
}