This function is calling a property on the psr_log service that may not exist. If the
service is swapped out there is no reason the replacement should have this property.
* CRM_Core_Error_Log constructor.
*/
public function __construct() {
- $this->map = [
+ $this->map = self::getMap();
+ }
+
+ /**
+ * @return array
+ */
+ public static function getMap():array {
+ return [
\Psr\Log\LogLevel::DEBUG => PEAR_LOG_DEBUG,
\Psr\Log\LogLevel::INFO => PEAR_LOG_INFO,
\Psr\Log\LogLevel::NOTICE => PEAR_LOG_NOTICE,
* @param array $event
*/
public function notify($event) {
- $levels = \Civi::log()->map;
+ $levels = \CRM_Core_Error_Log::getMap();
$event['level'] = array_search($event['priority'], $levels);
// Extract [civi.tag] from message string
// As noted in \CRM_Core_Error_Log::log() the $context array gets prematurely converted to string with print_r() so we have to un-flatten it here