Last active
April 5, 2017 13:52
-
-
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
This file contains 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
// 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