Skip to content

Instantly share code, notes, and snippets.

@sagormax
Created March 6, 2019 05:27
Show Gist options
  • Save sagormax/26285ca5cf07b98acdc393ecc83c568b to your computer and use it in GitHub Desktop.
Save sagormax/26285ca5cf07b98acdc393ecc83c568b to your computer and use it in GitHub Desktop.
Laravel 5 single log file name change
<?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