Laravel“ logging.php”-了解如何使用

时间:2019-07-15 13:30:36

标签: php laravel logging monolog

我正在与Laravel Log一起玩,我想了解文件logging.php是如何“导入” /“使用”的。

例如,daily频道包含:

    'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily'],
        ],

        'daily' => [
            'driver'    => 'daily',
            'path'      => storage_path('logs/laravel.log'),
            'level'     => env('LOG_LEVEL', 'debug'),
            'formatter' => \Monolog\Formatter\LineFormatter::class,
            'formatter_with' => [
                'format' => "[%datetime%] - %channel%.%level_name%: %message% %context% %extra%\n",
                'dateFormat' => "Y-m-d H:i:s",
            ],
            'days'      => 7,
        ],
    ]

如何将days => 7传递给\Monolog\Handler\RotatingFileHandler变量$maxFiles

其他键是什么(例如:formatterformatter_withdays, 我可以在通道数组中使用吗?

谢谢。

0 个答案:

没有答案