$loggerFactory must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\monolog\Logger\MonologLoggerChannelFactory given

Created on 13 March 2025, about 1 month ago

Problem/Motivation

I'm using Drupal 9.5.11
After declaring channel logger in custom service I got the error $loggerFactory must be of type Drupal\Core\Logger\LoggerChannelFactory, Drupal\monolog\Logger\MonologLoggerChannelFactory given

Steps to reproduce

Use '@logger.factory' as the argument or use parent: logger.channel_base

Proposed resolution

logger.channel.my_channel:
class: 'Drupal\Core\Logger\LoggerChannel'
arguments: ['my_channel']

🐛 Bug report
Status

Needs review

Version

2.2

Component

Code

Created by

🇻🇳Vietnam cp19112000

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

Comments & Activities

Production build 0.71.5 2024