'laravel schedule : clouser function is not getting called or executed

Consider below is my kernel.php:

protected function schedule(Schedule $schedule) {

    Log::info('Testing scheduler output');
    $schedule->call(function () {
        Log::info('Testing scheduler: ' . date("d/m/Y h:i:sa"));
    });
    
  exit;
}

I am trying to run the scheduler by below command :

php artisan schedule:run

Expected output is :

[current timestamp] local.INFO: Testing scheduler output
[current timestamp] local.INFO: Testing scheduler: <current_timestamp>  

Actual output what I am getting is :

[current timestamp] local.INFO: Testing scheduler output  

I am not able to understand why closure function's log is not generated or that code is not executed



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source