frankflow / laravel-forge-logs
A Laravel Forge API wrapper for logs
Fund package maintenance!
FrankFlow
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/frankflow/laravel-forge-logs
Requires
- php: ^8.4
- illuminate/contracts: ^11.0||^12.0
- laravel/prompts: ^0.3.7
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
README
Laravel Forge Logs
A Laravel package that integrates with the Laravel Forge API to fetch and manage application logs 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
- Store logs locally for analysis
- Simple artisan commands for easy integration
- [Coming Soon] access to nginx file error
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
.env
file with the configuration
USAGE: Fetching Logs
Once configured, fetch your application logs with:
php artisan forge-fetch-log
The logs will be saved to storage/logs/laravel.log
by default.
[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'), ];
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.