Skip to content

Commit

Permalink
Update logging config (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Mar 10, 2024
1 parent 8d3ffe8 commit 9e308a3
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions config/logging.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;

return [

Expand All @@ -19,6 +20,22 @@

'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' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => false,
],

/*
|--------------------------------------------------------------------------
| Log Channels
Expand All @@ -37,27 +54,23 @@
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],

'stacksentry' => [
'driver' => 'stack',
'channels' => ['single', 'sentry'],
'ignore_exceptions' => false,
'channels' => explode(',', env('LOG_STACK_CHANNELS', 'single')),
'ignore_exceptions' => env('LOG_STACK_IGNORE_EXCEPTIONS', false),
],

'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'level' => env('LOG_LEVEL', 'notice'),
'days' => 14,
'replace_placeholders' => true,
],

'slack' => [
Expand All @@ -66,21 +79,24 @@
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],

'papertrail' => [
'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class,
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],

'sentry' => [
'driver' => 'sentry',
'level' => 'debug',
'level' => env('LOG_LEVEL', 'notice'),
'bubble' => true,
],

Expand All @@ -92,16 +108,20 @@
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],

'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => LOG_USER,
'replace_placeholders' => true,
],

'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],

'null' => [
Expand Down

0 comments on commit 9e308a3

Please sign in to comment.