hillushilbert/sin-laravel-graylog

This package is abandoned and no longer maintained. No replacement package was suggested.

v1.0.9 2022-04-13 23:46 UTC

This package is not auto-updated.

Last update: 2023-10-26 06:58:18 UTC


README

    'graylog' => [
        'driver' => 'monolog',
        'handler' => Monolog\Handler\GelfHandler::class,
        'handler_with' => [
            'publisher' =>  app(Hillus\SinLaravelGraylog\Services\GraylogSetup::class)->getGelfPublisher(),
        ],
        // 'formatter' => \Monolog\Formatter\GelfMessageFormatter::class
        'formatter' => Hillus\SinLaravelGraylog\Log\GraylogMessageFormatter::class
    ], 


## Log Mysql 

Usando como base o artigo de custom log em mysql
https://alucard001.medium.com/laravel-6-custom-logging-to-mysql-database-step-by-step-hand-holding-50e07bdcbb65


Edite o arquivo config/logging.php e adicione o código abaixo no array
'channels' => [
    'stack' => [
        'driver' => 'stack',
        'channels' => ['sinlog', 'single'], // aqui vamos pegar além do log normal o stack de error
        'ignore_exceptions' => false,
    ],
    /////////////////////////////////////////////////
    ///// Just look at below// Log to MySQL
    'sinlog' => [
        'driver' => 'custom',
        'handler' => Hillus\SinLaravelGraylog\Logging\MySQLLoggingHandler::class,
        'via' => Hillus\SinLaravelGraylog\Logging\MySQLCustomLogger::class,
        'level' => 'debug',
    ],

    ////// Just look at above
    /////////////////////////////////////////////////