Skip to content

[Illuminate\Contracts\Log\ContextLogProcessor] is not instantiable while buildingΒ #515

@Yudingding

Description

@Yudingding

Hello everyone!
When I was using the react/http library to start the project in command-line mode, the Log reported this error during initialization.
It doesn't affect the usage of Log, but causes it to fall back to using the emergency channel.

It appears that this code snippet isn't working properly:

class ContextServiceProvider extends ServiceProvider
{
    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $this->app->scoped(Repository::class);

        $this->app->bind(ContextLogProcessorContract::class, fn () => new ContextLogProcessor());
    }
}

I tried manually binding it in AppServiceProvider like this:

$this->app->bind(
    ContextLogProcessor::class,
    ConcreteContextLogProcessor::class
);

And then it worked normally. I'm not sure if this is an actual issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions