Changeset View
Changeset View
Standalone View
Standalone View
src/config/logging.php
<?php | <?php | ||||
use Monolog\Handler\NullHandler; | |||||
use Monolog\Handler\StreamHandler; | use Monolog\Handler\StreamHandler; | ||||
use Monolog\Handler\SyslogUdpHandler; | use Monolog\Handler\SyslogUdpHandler; | ||||
return [ | return [ | ||||
/* | /* | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| Default Log Channel | | Default Log Channel | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| | | | ||||
| This option defines the default log channel that gets used when writing | | This option defines the default log channel that gets used when writing | ||||
| messages to the logs. The name specified in this option should match | | messages to the logs. The name specified in this option should match | ||||
| one of the channels defined in the "channels" configuration array. | | one of the channels defined in the "channels" configuration array. | ||||
| | | | ||||
*/ | */ | ||||
'default' => env('LOG_CHANNEL', 'stack'), | 'default' => env('LOG_CHANNEL', 'stack'), | ||||
/* | /* | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| Deprecations Log Channel | |||||
|-------------------------------------------------------------------------- | |||||
| | |||||
| This option controls the log channel that should be used to log warnings | |||||
| regarding deprecated PHP and library features. This allows you to get | |||||
| your application ready for upcoming major versions of dependencies. | |||||
| | |||||
*/ | |||||
'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), | |||||
/* | |||||
|-------------------------------------------------------------------------- | |||||
| Log Channels | | Log Channels | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| | | | ||||
| Here you may configure the log channels for your application. Out of | | Here you may configure the log channels for your application. Out of | ||||
| the box, Laravel uses the Monolog PHP logging library. This gives | | the box, Laravel uses the Monolog PHP logging library. This gives | ||||
| you a variety of powerful log handlers / formatters to utilize. | | you a variety of powerful log handlers / formatters to utilize. | ||||
| | | | ||||
| Available Drivers: "single", "daily", "slack", "syslog", | | Available Drivers: "single", "daily", "slack", "syslog", | ||||
| "errorlog", "monolog", | | "errorlog", "monolog", | ||||
| "custom", "stack" | | "custom", "stack" | ||||
| | | | ||||
*/ | */ | ||||
'channels' => [ | 'channels' => [ | ||||
'stack' => [ | 'stack' => [ | ||||
'driver' => 'stack', | 'driver' => 'stack', | ||||
'channels' => ['daily'], | 'channels' => ['daily'], | ||||
'ignore_exceptions' => false, | 'ignore_exceptions' => false, | ||||
], | ], | ||||
'single' => [ | 'single' => [ | ||||
'driver' => 'single', | 'driver' => 'single', | ||||
'path' => storage_path('logs/laravel.log'), | 'path' => storage_path('logs/laravel.log'), | ||||
'level' => 'debug', | 'level' => env('LOG_LEVEL', 'debug'), | ||||
], | ], | ||||
'daily' => [ | 'daily' => [ | ||||
'driver' => 'daily', | 'driver' => 'daily', | ||||
'path' => storage_path('logs/laravel.log'), | 'path' => storage_path('logs/laravel.log'), | ||||
'level' => 'debug', | 'level' => env('LOG_LEVEL', 'debug'), | ||||
'days' => 14, | 'days' => 14, | ||||
], | ], | ||||
'slack' => [ | 'slack' => [ | ||||
'driver' => 'slack', | 'driver' => 'slack', | ||||
'url' => env('LOG_SLACK_WEBHOOK_URL'), | 'url' => env('LOG_SLACK_WEBHOOK_URL'), | ||||
'username' => 'Laravel Log', | 'username' => 'Laravel Log', | ||||
'emoji' => ':boom:', | 'emoji' => ':boom:', | ||||
'level' => 'critical', | 'level' => env('LOG_LEVEL', 'critical'), | ||||
], | ], | ||||
'papertrail' => [ | 'papertrail' => [ | ||||
'driver' => 'monolog', | 'driver' => 'monolog', | ||||
'level' => 'debug', | 'level' => env('LOG_LEVEL', 'debug'), | ||||
'handler' => SyslogUdpHandler::class, | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), | ||||
'handler_with' => [ | 'handler_with' => [ | ||||
'host' => env('PAPERTRAIL_URL'), | 'host' => env('PAPERTRAIL_URL'), | ||||
'port' => env('PAPERTRAIL_PORT'), | 'port' => env('PAPERTRAIL_PORT'), | ||||
'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'), | |||||
], | ], | ||||
], | ], | ||||
'stderr' => [ | 'stderr' => [ | ||||
'driver' => 'monolog', | 'driver' => 'monolog', | ||||
'level' => env('LOG_LEVEL', 'debug'), | |||||
'handler' => StreamHandler::class, | 'handler' => StreamHandler::class, | ||||
'formatter' => env('LOG_STDERR_FORMATTER'), | 'formatter' => env('LOG_STDERR_FORMATTER'), | ||||
'with' => [ | 'with' => [ | ||||
'stream' => 'php://stderr', | 'stream' => 'php://stderr', | ||||
], | ], | ||||
], | ], | ||||
'syslog' => [ | 'syslog' => [ | ||||
'driver' => 'syslog', | 'driver' => 'syslog', | ||||
'level' => 'debug', | 'level' => env('LOG_LEVEL', 'debug'), | ||||
], | ], | ||||
'errorlog' => [ | 'errorlog' => [ | ||||
'driver' => 'errorlog', | 'driver' => 'errorlog', | ||||
'level' => 'debug', | 'level' => env('LOG_LEVEL', 'debug'), | ||||
], | ], | ||||
'null' => [ | |||||
'driver' => 'monolog', | |||||
'handler' => NullHandler::class, | |||||
], | ], | ||||
'slow_log' => (float) env('LOG_SLOW_REQUESTS', 5), | 'emergency' => [ | ||||
'path' => storage_path('logs/laravel.log'), | |||||
], | |||||
], | |||||
]; | ]; |