pearl/lumen-log-rotate

在Lumen框架中旋转日志文件

1.0 2018-03-19 10:03 UTC

This package is auto-updated.

Last update: 2024-09-18 03:06:55 UTC


README

安装

composer require pearl/lumen-log-rotate

为了添加日志轮换功能,我们将使用自定义服务提供程序来配置日志实例并指定我们应保留的日志文件数量。

  • 在 bootstrap/app.php 中添加服务提供程序

$app->register(Pearl\LumenLogRotate\LogRotateServiceProvider::class);

自定义选项

  • 指定我们应保留的日志文件数量。默认值为 5。

    LOG_MAXFILE=3

  • 指定日志文件路径。默认日志路径为 storage/logs/lumen.log

    LOG_PATH=/path/log.log

    所有自定义配置都应添加到 .env 文件中。

日志文件夹视图

lumen-2018-03-19.log
lumen-2018-03-20.log
lumen-2018-03-21.log
lumen-2018-03-22.log
lumen-2018-03-23.log