承接 daz9e/laravel-log-compressor 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

daz9e/laravel-log-compressor

最新稳定版本:1.3

Composer 安装命令:

composer require daz9e/laravel-log-compressor

包简介

Lets you compress .log files in your laravel app by command or schedule.

README 文档

README

Usage

Run the command to compress log files older than a specified number of days and delete old compressed logs.

php artisan logs:compress [days]
  • days (optional): Number of days to keep logs uncompressed. Defaults to LOG_COMPRESS_DAYS in .env or 2 days.

Example

php artisan logs:compress 5

Compresses logs older than 5 days and deletes .gz files older than 14 days (configurable in config/logging.php).

Configuration

In config/logging.php:

  • compress_days: Days to keep logs uncompressed (default: 2). Override via .env:
    LOG_COMPRESS_DAYS=5
  • logging.channels.daily.days: Retention period for compressed logs (default: 14 days).

Scheduling

Scheduled to run daily in routes/console.php:

Schedule::command('logs:compress')->daily();

Ensure the Laravel scheduler is set up:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

统计信息

  • 总下载量: 219
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-22