I created a subscriber that listen to Http Client events (ConnectionFailed, ResponseReceived) to log all http requests. It works fine when I make a request in controller, but when I make a request in tinker or in a command, nothing will log. Do you have any idea what's the problem?
But it works in a fresh Laravel.
I tried chmod -R 777 storage/logs
Adding
public function shouldDiscoverEvents()
{
return true;
}
to EventServiceProvider.
Adding APP_LOG_LEVEL=debug
to .env
Also
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