LaravelPackages.net
Acme Inc.
Toggle sidebar
adevpmftc/laravel-custom-logging

Custom logging for AWS cloudwatch containers

6
0
0.2.0
About adevpmftc/laravel-custom-logging

adevpmftc/laravel-custom-logging is a Laravel package for custom logging for aws cloudwatch containers. It currently has 0 GitHub stars and 6 downloads on Packagist (latest version 0.2.0). Install it with composer require adevpmftc/laravel-custom-logging. Discover more Laravel packages by adevpmftc or browse all Laravel packages to compare alternatives.

Last updated

Laravel Custom Logging

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 adevpmftc/laravel-custom-logging

Publish the config file:

php artisan vendor:publish --provider="AdevPmftc\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' => [\AdevPmftc\LaravelCustomLogging\AddOriginProcessor::class],
    ],
],
Comments