From b6cda82a8a7a35e3d734dd31681bd267309f8008 Mon Sep 17 00:00:00 2001 From: Sunil Pawar Date: Mon, 10 Aug 2020 17:39:22 +0530 Subject: [PATCH 1/3] dev/core#1943 add functionality to add civicrm log into Drupal access log --- CRM/Core/Error.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 04f7e8cd39fa..215e336426c9 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -586,6 +586,9 @@ public static function debug_log_message($message, $out = FALSE, $prefix = '', $ if ($config->userSystem->is_drupal and function_exists('watchdog')) { watchdog('civicrm', '%message', ['%message' => $message], $priority ?? WATCHDOG_DEBUG); } + else if ($config->userSystem->is_drupal and CIVICRM_UF == 'Drupal8') { + \Drupal::logger('civicrm')->debug($message); + } } return $str; From 6f12b3443c9d9dc5be70d1c07d18eac15123fa47 Mon Sep 17 00:00:00 2001 From: Sunil Pawar Date: Mon, 10 Aug 2020 17:42:20 +0530 Subject: [PATCH 2/3] small correction --- CRM/Core/Error.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 215e336426c9..46c61d2c9b83 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -586,7 +586,7 @@ public static function debug_log_message($message, $out = FALSE, $prefix = '', $ if ($config->userSystem->is_drupal and function_exists('watchdog')) { watchdog('civicrm', '%message', ['%message' => $message], $priority ?? WATCHDOG_DEBUG); } - else if ($config->userSystem->is_drupal and CIVICRM_UF == 'Drupal8') { + elseif ($config->userSystem->is_drupal and CIVICRM_UF == 'Drupal8') { \Drupal::logger('civicrm')->debug($message); } } From 75f084993ee348da0e745142e7c33cd7d6c11d48 Mon Sep 17 00:00:00 2001 From: Sunil Pawar Date: Mon, 10 Aug 2020 19:00:45 +0530 Subject: [PATCH 3/3] Correction to change priority level --- CRM/Core/Error.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index 46c61d2c9b83..ee418c306b8b 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -587,7 +587,7 @@ public static function debug_log_message($message, $out = FALSE, $prefix = '', $ watchdog('civicrm', '%message', ['%message' => $message], $priority ?? WATCHDOG_DEBUG); } elseif ($config->userSystem->is_drupal and CIVICRM_UF == 'Drupal8') { - \Drupal::logger('civicrm')->debug($message); + \Drupal::logger('civicrm')->log($priority ?? \Drupal\Core\Logger\RfcLogLevel::DEBUG, '%message', ['%message' => $message]); } }