Answer the question
In order to leave comments, you need to log in
Laravel log to a custom file, sculpts all the errors in a row?
$app = ['aaa' => 123];
Log::useFiles(base_path() . '/storage/logs/steam_apps_sync.log', 'info');
Log::info(json_encode($app) . '\r\n');
Answer the question
In order to leave comments, you need to log in
Monolog is built into Laravel (I advise you to study it if you are interested in the topic of logs), it has the ability to track event types , here 's an example :
$app->configureMonologUsing(function ($monolog) use ($app) {
$monolog->pushHandler(new Monolog\Handler\StreamHandler($app->storagePath() . '/logs/info.log', Monolog\Logger::DEBUG, false));
$monolog->pushHandler(new Monolog\Handler\StreamHandler($app->storagePath() . '/logs/laravel.log', Monolog\Logger::NOTICE, false));
return $monolog;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question