peipei/beanstalk-logger-channel

Send log message as a job to beanstalk

v1.0.4 2024-08-14 01:42 UTC

This package is auto-updated.

Last update: 2024-09-14 01:49:55 UTC


README

Send log message as a job to beanstalk

Install


composer require peipei/beanstalk-logger-channel

Add to .env

BEANSTALKD_HOST=127.0.0.1
BEANSTALKD_JOB_TUBE=laravel-log

Add to config/logging.php file new channel:

'beanstalk' => [
    'driver' => 'custom',
    'via'    => Logger\BeanstalkJobLogger::class,
    'level'  => 'debug',
]

Add to config/beanstalk-logger.php

<?php

return [
    // Beanstalk host
    'host' => env('BEANSTALKD_HOST', '127.0.0.1'),

    // Beanstalk tube
    'tube' => env('BEANSTALKD_JOB_TUBE', 'laravel-log'),
];

If your default log channel is a stack, you can add it to the stack channel like this

'stack' => [
    'driver' => 'stack',
    'channels' => ['single', 'beanstalk'],
]