Skip to content

Instantly share code, notes, and snippets.

@jorgecolonconsulting
Last active June 5, 2020 02:29
Show Gist options
  • Save jorgecolonconsulting/9a142710fe9e8fac99434cbba492b03c to your computer and use it in GitHub Desktop.
Save jorgecolonconsulting/9a142710fe9e8fac99434cbba492b03c to your computer and use it in GitHub Desktop.
Laravel 5.6: Logging to console
<?php
return [
'default' => env('LOG_CHANNEL', 'stack'),
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => array_merge(['single'], php_sapi_name() === 'cli' ? ['stdout'] : []),
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'stdout' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stdout',
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment