Skip to content

Instantly share code, notes, and snippets.

@SohanChy
Created May 12, 2019 08:58
Show Gist options
  • Save SohanChy/fdfd84b8d40dc851b567a2185be19abd to your computer and use it in GitHub Desktop.
Save SohanChy/fdfd84b8d40dc851b567a2185be19abd to your computer and use it in GitHub Desktop.
Configuring Laravel for JSON Logging Using Monolog (For Kibana)
...
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
],
'single' => [
'driver' => 'monolog',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'handler' => Monolog\Handler\RotatingFileHandler::class,
'with' => [
'filename' => storage_path('logs/app.log')
],
'formatter' => Monolog\Formatter\JsonFormatter::class,
'formatter_with' => [
'dateFormat' => 'Y-m-d',
],
],
...
]
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment