【发布时间】: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