diff --git a/README.md b/README.md index 23e5068..a6a7612 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ add in `config/logging.php` in `channels` section: 'channel' => 'app'(security/reauest/order), 'processors' => [new Monolog\Processor\ProcessorInterface()], //OPTIONAL 'level' => Monolog\Logger::INFO, //OPTIONAL + 'stream_to' => 'php://stderr', //OPTIONAL ] 'security' => [ 'driver' => 'custom', @@ -72,6 +73,7 @@ add in `config/logging.php` in `channels` section: 'channel' => 'security', 'processors' => [new Monolog\Processor\ProcessorInterface()], //OPTIONAL 'level' => Monolog\Logger::INFO, //OPTIONAL + 'stream_to' => 'php://stderr', //OPTIONAL ], ``` diff --git a/src/Laravel/LaravelLoggerCreating.php b/src/Laravel/LaravelLoggerCreating.php index 2760b12..94037d7 100644 --- a/src/Laravel/LaravelLoggerCreating.php +++ b/src/Laravel/LaravelLoggerCreating.php @@ -28,6 +28,8 @@ public function __invoke(array $config) $processors = $config['processors'] ?? []; /** @var int $level */ $level = $config['level'] ?? Logger::DEBUG; + /** @var string $stream */ + $stream = $config['stream_to'] ?? 'php://stderr'; $log = new Logger($channel); $log->pushProcessor(new Processor()); @@ -37,7 +39,7 @@ public function __invoke(array $config) $log->pushProcessor($processor); } - $streamHandler = new StreamHandler('php://stderr', $level); + $streamHandler = new StreamHandler($stream, $level); $handler = $streamHandler; $env = App::environment();