Ok, a few thoughts...
- If you're going to extend the Illuminate\Foundation\Bootstrap\ConfigureLogging class, you need to override the configureHandlers() method it implements in order to add your custom handlers. The only way your current code could work is if you had edited the BaseConfigureLogging class to call
$this->configureCustomHandlers($app, $this->registerLogger($app));(line 17) - which would be a BAD idea. Your other choice is to just copy the entire BaseConfigureLogging Class to the bootstrap directory and make any changes you want there. But I think extending is fine - just changeconfigureCustomHandlerstoconfigureHandlers. - Next make sure you've registered your App/Bootstrap/ namespace in composer.json and ran
composer dumpautoload
I have this code which is working for me:
<?php namespace Bootstrap;
use Illuminate\Log\Writer;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Bootstrap\ConfigureLogging as BaseConfigureLogging;
use Monolog\Handler\StreamHandler;
class ConfigureLogging extends BaseConfigureLogging{
/**
* OVERRIDE PARENT
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureHandlers(Application $app, Writer $log)
{
$log->getMonolog()->pushHandler( new StreamHandler( storage_path() . "/logs/oneOff.log"));
$log->useDailyFiles($app->storagePath().'/logs/daily.log');
}
}