mardi 14 février 2017

Issue in set monolog in Laravel

I use this for logging . I tried to configure log rotation on but I'm stuck. I know how to do this with Laravel, I'm trying to create my own rotating log file in Laravel using Monolog, however, the file rotation is not working and I don't know why.

/* controller file */

use Illuminate\Http\Request;
use Monolog\Logger;
use Monolog\Handler\RotatingFileHandler;

public function getSheduled(){     
    $log = new Logger('getSheduled');
    $log->pushHandler(new RotatingFileHandler(storage_path().'/logs/cron_log/custom_log.log',2, Logger::INFO)); 
    $log->info(json_encode($followup_shedule_data));

}

It seemed pretty straightforward to me, but it's simply not working. The log files are being generated correctly but when When I see their output it give me like this:

/*text file */

    [2017-02-14 12:24:46] getSheduled.INFO: [] [] []

I don't want last 2 array from array.Please answer



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire