Skip to content

Instantly share code, notes, and snippets.

@mortenscheel
Last active April 5, 2017 13:52
Show Gist options
  • Save mortenscheel/df04eb791bc9f84b57d5842c93b7d166 to your computer and use it in GitHub Desktop.
Save mortenscheel/df04eb791bc9f84b57d5842c93b7d166 to your computer and use it in GitHub Desktop.
Laravel Monolog configuration to avoid permission problems when daily log files are created by artisan
// Add to bootstrap/app.php
/**
* Configure Monolog.
*/
$app->configureMonologUsing(function(Monolog\Logger $monolog) {
// Make different log files for web and cli to avoid permission problems
$filename = storage_path('logs/laravel-'.php_sapi_name().'.log');
$handler = new Monolog\Handler\RotatingFileHandler($filename);
$monolog->pushHandler($handler);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment