PHP Fatal error when enabling Event Log Track Syslog module in Drupal 10

Created on 16 February 2023, almost 2 years ago
Updated 20 June 2023, over 1 year ago

Problem/Motivation

There is a fatal PHP error with Event log track syslog sub module in Drupal 10.

Error message:

Drupal\levent log track syslog\Logger\EventLog::log($level, $message, array $context = []) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, Stringable string $message, array $context = ( ]): void in /app/web/modules/contrib/events_log_track/modules/event_log_track_syslog/src/Logger/EventLog.php file on line 128.

Steps to reproduce

  1. Install the Event Log Track Syslog module.

Proposed resolution

Update the method signature for Drupal\levent log track syslog\Logger\EventLog::log to be both D9 and D10 compatible.
From

 public function log($level, $message, array $context = []) {

To

  public function log($level, $message, array $context = []): void {

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia mingsong πŸ‡¦πŸ‡Ί

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024