1

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!

4

2 回答 2

4

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);
于 2019-04-24T09:38:21.353 回答
0

Another way is using Cache facade with method put(). Next, you can get this with Cache::get($cacheKey);. Here I can pass any data type: Collections, arrays, integer, string, etc. And that's its advantage

于 2021-12-02T11:55:12.460 回答