Вызов метода undefined при попытке зарегистрировать событие в laravel 8.0

Итак, я пытаюсь зарегистрировать событие (если оно не было успешным), но я всегда получаю эту ошибку

Вызов неопределенного метода Monolog \ Logger :: single () Это мой код для контроллера в каталоге app / console / commands.

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
use Illuminate\Support\Facades\Log;

class FPTrainCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'FPTrain:command';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        date_default_timezone_set('EST');
        $FPTree_date = date("Y-m-d");
        $my_array = array("$FPTree_date","association", "test");
        $FPJson = json_encode($my_array);
        $process = new Process(["python3", "public/python/FP_Tree.py", "$FPJson"]);
        $process->run();

        // executes after the command finishes
        if (!$process->isSuccessful()) {
            throw new ProcessFailedException($process);
            $date = date('l jS \of F Y h:i:s A');

        }
        Log::single("$FPTree_date Error Executing the daily association script");
        echo $FPJson;
        //dump(json_decode($process->getOutput(), true));
    }
}

Я не уверен, что делаю не так.

Спасибо за помощь


person Danilo Patrucco    schedule 21.11.2020    source источник
comment
Сообщение очень ясное: Monolog Logger не работает » У меня есть single метод. Откуда у вас этот метод?   -  person El_Vanja    schedule 22.11.2020
comment
Извини, мозговой пук на моем конце, он должен был сказать: где ты взял эту ошибку? Какая строка, какой файл ...   -  person El_Vanja    schedule 22.11.2020


Ответы (1)


В журнале laravel нет единого метода.

Согласно https://laravel.com/docs/8.x/logging, это функции, которые вы можете использовать:

Log::emergency($message);
Log::alert($message);
Log::critical($message);
Log::error($message);
Log::warning($message);
Log::notice($message);
Log::info($message);
Log::debug($message);
person Giacomo M    schedule 21.11.2020
comment
Спасибо, теперь я должен выяснить, почему не записывает данные в папку, в которой должны храниться журналы, но это избавило меня от большой головной боли. не уверен, где я взял строку с синглом. - person Danilo Patrucco; 22.11.2020
comment
проверьте файл config / logging.php - person Giacomo M; 22.11.2020