diff --git a/src/A1comms/GaeSupportLaravel/Foundation/Application.php b/src/A1comms/GaeSupportLaravel/Foundation/Application.php index 4f3b348..26a6a01 100755 --- a/src/A1comms/GaeSupportLaravel/Foundation/Application.php +++ b/src/A1comms/GaeSupportLaravel/Foundation/Application.php @@ -78,11 +78,18 @@ public function __construct($basePath = null) $monolog->pushHandler(new PsrHandler($logging->psrLogger('app', ['batchEnabled' => true]))); }); } else { - $this->configureMonologUsing(function ($monolog) { - $handler = new StreamHandler($this->storagePath('logs/lumen.log')); - $handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true, true)); - $monolog->pushHandler($handler); - }); + // write errors to command line when running command line commands + if ($this->runningInConsole()) { + $this->configureMonologUsing(function($monolog) { + $monolog->pushHandler(new \Monolog\Handler\StreamHandler('php://stdout', \Monolog\Logger::INFO, false)); // false value as third argument to disable bubbling up the stack + }); + } else { + $this->configureMonologUsing(function ($monolog) { + $handler = new StreamHandler($this->storagePath('logs/lumen.log')); + $handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true, true)); + $monolog->pushHandler($handler); + }); + } } $this->replaceDefaultSymfonyLineDumpers();