【问题标题】:Laravel Http Client events not firing from terminalLaravel Http 客户端事件未从终端触发
【发布时间】:2021-11-03 14:49:47
【问题描述】:

我创建了一个订阅者,它监听 Http 客户端事件(ConnectionFailed、ResponseReceived)来记录所有 http 请求。当我在控制器中发出请求时它工作正常,但是当我在修补程序或命令中发出请求时,什么都不会记录。 你知道有什么问题吗?

但它适用于新的 Laravel。

我试过chmod -R 777 storage/logs

添加

public function shouldDiscoverEvents()
{
    return true;
}

到 EventServiceProvider。 将APP_LOG_LEVEL=debug 添加到 .env 还有

sudo rm -rf storage/framework/cache/data/*
sudo rm -rf bootstrap/cache/*
composer dump-autoload
php artisan clear
php artisan debugbar:clear
php artisan cache:clear
php artisan auth:clear-resets
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:forget spatie.permission.cache

【问题讨论】:

    标签: laravel event-handling subscriber


    【解决方案1】:

    在我的情况下, imanghafoori/laravel-microscope 包导致了这个问题。 我创建了一个问题:https://github.com/imanghafoori1/laravel-microscope/issues/161

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-19
      相关资源
      最近更新 更多