gpxcat/laravel_log_formatter

There is no license information available for the latest version (1.3) of this package.

自製的 Laravel Log 格式化

1.3 2024-01-19 02:28 UTC

This package is auto-updated.

Last update: 2025-06-19 05:31:34 UTC


README

Add the .env file:

LOG_CHANNEL=stack
GRAYLOG_URL=10.1.6.38
GRAYLOG_PORT=12201
IFCONFIG_URL=http://10.1.1.188:8080/ip

Add the config to your config/logging.php file:

'stack' => [
    'driver' => 'stack',
    'channels' => ['daily', 'graylog'],
    'ignore_exceptions' => true,
    // ...
],
'daily' => [
    'driver' => 'daily',
    // ...
    'tap' => [\Gpxcat\LaravelLogFormatter\Formatter::class],
    // ...
],
'graylog' => [
    'driver' => 'custom',
    'via' => \Gpxcat\LaravelLogFormatter\GraylogLogger::class,
    'host' => env('GRAYLOG_URL', ''),
    'port' => env('GRAYLOG_PORT', ''),
    'level' => env('LOG_LEVEL', 'debug'),
],