Skip to content

CoreProc/laravel-custom-logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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],
    ],
],

About

Custom logging for CoreProc AWS cloudwatch containers

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages