I can't log anything from my Job's handle method, with the Log
facade. Logging from controller or other part of the application with this facade works fine.
I have tried the solution here : Logging not working in laravel queue job, but it does not work with Laravel 6.17, and here : https://stackoverflow.com/a/55206727/10767428 , but it does not affect behaviour in any way.
- PHP 7.2
- Laravel 6.17
APP_ENV=local
APP_LOG_LEVEL=debug
- Laravel runs inside Docker with Alpine image and other stuff unrelated
Here is my job :
class MyJob implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
public function handle()
{
Log::warning("HI");
}
}
The Job is correctly handled when I dispatch if, but nothing shows up in my storage/app/logs/laravel.log
.
This file and the entire folder storage
has 777 permissions.
I use "single" driver in config/logging.php
:
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
Any ideas?
EDIT 07/17/2020
As requested, here is my config.horizon.php
:
EDIT 07/20/2020
I can log from the same job when I use dipatchNow
method to call it, instead of dispatch
one. Any ideas why ?