Created
March 6, 2019 05:27
-
-
Save sagormax/26285ca5cf07b98acdc393ecc83c568b to your computer and use it in GitHub Desktop.
Laravel 5 single log file name change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# CUSTOM DAILY LOG | |
// $app->configureMonologUsing(function($monolog) use ($app) { | |
// $monolog->pushHandler( | |
// (new Monolog\Handler\RotatingFileHandler( | |
// // Set the log path | |
// $app->storagePath().'/logs/app_error.log', | |
// // Set the number of daily files you want to keep | |
// $app->make('config')->get('app.log_max_files', 30) | |
// ))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true, true)) | |
// ); | |
// }); | |
# SINGLE LOG | |
$app->configureMonologUsing(function($monolog) use ($app) { | |
$handler = new Monolog\Handler\StreamHandler($app->storagePath().'/logs/app_error.log'); | |
$handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true, true)); | |
$monolog->pushHandler($handler); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment