Hi,

The problem:
Search API accepts a Logger instance witch is restricted to \Drupal\Core\Logger\LoggerChannelInterface.
This forbids the use of any other logger, such as Monolog.

Reading class comments in LoggerChannelInterface:

This interface defines the full behavior of the central Drupal logger
facility. However, when writing code that does logging, use the generic
\Psr\Log\LoggerInterface for typehinting instead (you shouldn't need the
methods here).

It appears that methods of that interface are quite internal.

Proposed solution:
Replace \Drupal\Core\Logger\LoggerChannelInterface with \Psr\Log\LoggerInterface.

I guess the testbot should tell me if LoggerChannelInterface methods are effectively used.

The patch attached implements the proposed solution.

Comments

manu manu created an issue. See original summary.

manu-manu’s picture

StatusFileSize
new6.59 KB
borisson_’s picture

Status: Active » Needs review

Let's see how the bot feels about this.

Status: Needs review » Needs work

The last submitted patch, 2: 2733129-search_api-psr-logger.patch, failed testing.

The last submitted patch, 2: 2733129-search_api-psr-logger.patch, failed testing.

manu-manu’s picture

Doh, I didn't noticed made this patch on 8.x-1.0-alpha14.

Will reroll a patch soon.

rajeshwari10’s picture

Status: Needs work » Needs review
StatusFileSize
new3.61 KB

I tried to reroll the patch but it always failed.

So done all the changes manually in Search API 8.x-1.x version.

Thanks!!

rajeshwari10’s picture

Assigned: manu-manu » rajeshwari10
drunken monkey’s picture

StatusFileSize
new2.3 KB
new5.85 KB

Thanks a lot, both of you – for pointing out this mistake and providing patches.

rajeshwari10, you forgot the SearchApiRow class, though. The attached patch fixes that class, too.
If the test bot is happy with that, I'll commit it.

drunken monkey’s picture

Status: Needs review » Fixed

Committed.
Thanks again!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

rajeshwari10’s picture

Assigned: rajeshwari10 » Unassigned