laravelredisqueuehorizon

Debug Laravel Queues


I am new to laravel queues but this situation has occurred to me and I have no clue to fix . I am processing a queue using dispatch method and wanted to print an array in a service called in job class. I have tried print_r , dd with exit but nothing is working.

PS: I am using redis and debugging the queues in horizon. I am also checking logs for any exception but its not showing print_r result there.

Please suggest if there is a way to do it.

Thanks in advance!


Solution

  • dd() and print_r won't work.

    wanted to print an array in a service called in job class

    You should use Log what you want to debug and check last logs in storage/logs folder. Often it is laravel.log file. You can any following method.

    use Illuminate\Support\Facades\Log;
    
    Log::debug($message);