frankflow/laravel-forge-logs
Composer 安装命令:
composer require frankflow/laravel-forge-logs
包简介
A Laravel Forge API wrapper for logs
README 文档
README
Laravel Forge Logs
A Laravel package that integrates with the Laravel Forge API to fetch and manage application logs (laravel and nginx) from your Forge-managed sites. Simplify log retrieval and monitoring with interactive CLI commands.
Why this package
With the use of AI, it is increasingly necessary to access logs remotely to speed up bug fixing.
Features
- Interactive setup wizard to configure your Forge organization, server, and site
- Fetch application logs directly from Laravel Forge
- Fetch nginx access logs from Laravel Forge
- Fetch nginx error logs from Laravel Forge
- Customizable log file paths and filenames
- Store logs locally for analysis
- Simple artisan commands for easy integration
Requirements
- PHP 8.4+
- Laravel 11.x or 12.x
Installation
You can install the package via Composer:
composer require frankflow/laravel-forge-logs --dev
Get Your Laravel Forge API Token
First, obtain your API token from Laravel Forge:
- Log in to Laravel Forge
- Go to your account settings
- Navigate to the API section
- Generate a new API token (make sure you set the right scopes for the token)
Add Your Forge Token to .env
Add the following line to your .env file:
FORGE_TOKEN=your-forge-api-token-here
Run the Interactive Setup
Run the initialization command to configure your organization, server, and site:
php artisan forge-init
This interactive command will:
-
Automatically update your
.envfile with the configuration
USAGE: Fetching Logs
Once configured, you can fetch different types of logs:
Fetch All Logs (Recommended)
php artisan forge-fetch-logs
# or
php artisan forge-all-logs
This command will fetch Laravel application logs, Nginx access logs, and Nginx error logs in sequence.
Fetch Individual Logs
Application Logs
php artisan forge-laravel-logs
Saves to storage/logs/laravel.log (customizable in config).
Nginx Access Logs
php artisan forge-nginx-access-logs
Saves to storage/logs/nginx/access.log (customizable in config).
Nginx Error Logs
php artisan forge-nginx-error-logs
Saves to storage/logs/nginx/error.log (customizable in config).
Delete Site Logs
php artisan forge-delete-logs
Interactively deletes logs on the configured site via the Forge API. The command presents a menu to select which logs to delete:
Options:
Skip the confirmation prompt with --force:
php artisan forge-delete-logs --force
⚠️ Warning: Log deletion is permanent and cannot be undone.
[Optional] Publishing Configuration
Publish the configuration file:
php artisan vendor:publish --tag="forge-logs-config"
This will create a config/forge-logs.php file with the following structure:
return [ 'forge_token' => env('FORGE_TOKEN'), 'forge_server_id' => env('FORGE_SERVER_ID'), 'forge_site_id' => env('FORGE_SITE_ID'), 'forge_organization' => env('FORGE_ORGANIZATION'), // Customize log file paths (relative to storage_path()) 'log_paths' => [ 'laravel' => 'logs/laravel.log', 'nginx_access' => 'logs/nginx/access.log', 'nginx_error' => 'logs/nginx/error.log', ], ];
Customizing Log File Paths
You can customize where the logs are saved by modifying the log_paths array in config/forge-logs.php:
'log_paths' => [ 'laravel' => 'logs/forge/laravel.log', // Change path 'nginx_access' => 'logs/forge/nginx-access.log', // Change path and filename 'nginx_error' => 'logs/forge/nginx-error.log', // Change path and filename ],
All paths are relative to the storage_path() directory.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
frankflow/laravel-forge-logs 适用场景与选型建议
frankflow/laravel-forge-logs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 33 次下载、GitHub Stars 达 4, 最近一次更新时间为 2025 年 10 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「FrankFlow」 「laravel-forge-logs」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 frankflow/laravel-forge-logs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 frankflow/laravel-forge-logs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 frankflow/laravel-forge-logs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
Turn any PDF into a Pingen-ready A4 letter (generated address cover page + A4 normalisation + safe margins) and send it through the Pingen print & mail API. Laravel-first.
统计信息
- 总下载量: 33
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-08




