coreproc / laravel-custom-logging
Custom logging for AWS cloudwatch containers
Installs: 3 403
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2024-10-25 01:56:20 UTC
README
This package provides us with an additional origin
variable for logs to determine the source of the log.
Installation
You can install the package via composer:
composer require coreproc/laravel-custom-logging
Publish the config file:
php artisan vendor:publish --provider="Coreproc\LaravelCustomLogging\CustomLoggingServiceProvider"
Usage
Typically, we use this in the stderr
channel. Here is an example of the configuration:
'channels' => [ 'stderr' => [ 'driver' => 'monolog', 'level' => env('LOG_LEVEL', 'debug'), 'handler' => StreamHandler::class, 'formatter' => Monolog\Formatter\JsonFormatter::class, 'formatter_with' => [ 'includeStacktraces' => true, 'batchMode' => Monolog\Formatter\JsonFormatter::BATCH_MODE_JSON, 'appendNewline' => true, ], 'with' => [ 'stream' => 'php://stderr', ], 'processors' => [\Coreproc\LaravelCustomLogging\AddOriginProcessor::class], ], ],