Commit 547b8745 authored by alexpott's avatar alexpott

Issue #1987262 by the_phi, clemens.tolboom, Damien Tournoud, bshaffer:...

Issue #1987262 by the_phi, clemens.tolboom, Damien Tournoud, bshaffer: [Installation Error] Symfony: "The service definition 'request' does not exist.".
parent 30f6062a
......@@ -1568,13 +1568,23 @@ function watchdog($type, $message, array $variables = NULL, $severity = WATCHDOG
'link' => $link,
'user' => $user,
'uid' => $user_uid,
'request_uri' => $base_root . request_uri(),
'referer' => isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '',
'ip' => Drupal::request()->getClientIP(),
'request_uri' => '',
'referer' => '',
'ip' => '',
// Request time isn't accurate for long processes, use time() instead.
'timestamp' => time(),
);
try {
$request = Drupal::request();
$log_entry['request_uri'] = $request->getUri();
$log_entry['referer'] = $request->headers->get('Referer', '');
$log_entry['ip'] = $request->getClientIP();
}
catch (\InvalidArgumentException $e) {
// We are not in a request context.
}
// Call the logging hooks to log/process the message
foreach (module_implements('watchdog') as $module) {
$function = $module . '_watchdog';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment