承接 rafaatabtahe/api-logger 相关项目开发

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

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

rafaatabtahe/api-logger

最新稳定版本:v1.0.0

Composer 安装命令:

composer require rafaatabtahe/api-logger

包简介

A Laravel package for API response time logging and monitoring dashboard

README 文档

README

A Laravel package for API response time logging and monitoring dashboard.

Features

  • 📊 Response Time Logging: Automatically logs all API response times
  • 📈 Beautiful Dashboard: Modern monitoring dashboard with charts
  • Real-time Stats: Average, min, max response times
  • 🔧 Configurable: Customize excluded routes, retention period, branding
  • 🚀 Zero Configuration: Works out of the box with sensible defaults

Installation

Via Composer

Add the repository to your composer.json:

{
    "repositories": [
        {
            "type": "path",
            "url": "./packages/rafaatabtahe/api-logger"
        }
    ]
}

Then require the package:

composer require rafaatabtahe/api-logger

Publish Configuration (Optional)

php artisan vendor:publish --tag=api-response-logger-config

Publish Views (Optional)

php artisan vendor:publish --tag=api-response-logger-views

Configuration

The configuration file config/api-response-logger.php allows you to customize:

return [
    // Enable/disable logging
    'enabled' => true,

    // Log file path
    'log_path' => storage_path('logs/api_response_logs.json'),

    // Routes to exclude from logging
    'excluded_routes' => [
        '/',
        '/api-status',
        '/api-stats',
    ],

    // Log retention in hours
    'retention_hours' => 24,

    // Dashboard settings
    'dashboard' => [
        'enabled' => true,
        'app_name' => 'My API',
        'subtitle' => 'API Server',
        'developer' => [
            'name' => 'Your Name',
            'url' => 'https://your-site.com',
        ],
    ],

    // Slow request threshold in ms
    'slow_threshold' => 500,
];

Environment Variables

API_RESPONSE_LOGGER_ENABLED=true
API_RESPONSE_LOGGER_RETENTION=24
API_RESPONSE_LOGGER_DASHBOARD=true
API_RESPONSE_LOGGER_SLOW_THRESHOLD=500

Routes

The package registers the following routes:

Route Description
/ Monitoring dashboard
/api-status JSON status endpoint
/api-stats JSON statistics endpoint

License

MIT License

Author

Rafaat Abtahe

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-24