Declaration of FilesLog::log(...) must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log(...)

Created on 23 November 2023, over 1 year ago
Updated 9 January 2024, about 1 year ago

Problem/Motivation

Hello, I have recently updated my project from its version of Drupal, everything is fine, I have already changed from PHP 7 to PHP 8.1 and when I want to update my fileslog module from version 1.0.4, it generates the following error:

[error] 110432#110432: *751 FastCGI sent in stderr: "PHP message: PHP Fatal error: Declaration of Drupal\fileslog\Logger\FilesLog::log($level, Stringable|string $message, array $context = []): void must be compatible with Drupal\Core\Logger\RfcLoggerTrait::log($level, $message, array $context = []) in /var/www/example.com/modules/contrib/fileslog/src/Logger/FilesLog.php on line 36" while reading response header from upstream, client: 11.2222.777.788, server: example.com, request: "POST /views/ajax HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "example.com", referrer: "https://example.com/my-pàge"

My drupal version is 9.5.11
My PHP version is PHP 8.1
My serveris nginx
My data base is Mysql 5.7

And I emphasize the problem comes from version 1.0.4 and I even tried the latest version 1.1.1 and it gives me the same error

💬 Support request
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Issue created by @Nelo_Drup
  • Status changed to Needs review over 1 year ago
  • 🇧🇪Belgium RandalV

    Hi @Nelo_drup,

    Could you try fixing the version to 1.0.3?
    composer require "drupal/fileslog:1.0.3"

    Sadly some dependencies got mixed up between version 1.0.4 and 1.1.0, version 1.0.4 was supposed to be in the 1.1.x range because it requires PHP 8.1 + Drupal 10.x.

    In reality, Fileslog 1.0.3 is the last version that supports 9.5.x.

  • #2 I understand, it's okay if it returns to the latest version that works for me, that would be good to put it on the module page since in Drupal itself version 1.1.1 appears as a suggested update

  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇧🇪Belgium RandalV

    Changing metadata

Production build 0.71.5 2024