mothership-app / php-logs
Error logging library for Mothership.app
Installs: 5 387
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.0.0 <9.0
- ext-curl: *
- monolog/monolog: ^2 || ^3
- psr/log: ^1 || ^2 || ^3
This package is auto-updated.
Last update: 2025-01-17 23:52:19 UTC
README
About
Mothership PHP Logs allows you to log server-side errors to your Mothership account where you can gather and organize logs in addition to performing backups, healthchecks, and sync your devlopment box with your various environments in seconds.
Once you've signed up let's get started!
Install through composer
composer require mothership-app/php-logs
General PHP
use Mothership\Mothership; Mothership::init([ 'access_token' => 'XXXXXXXXX - YOUR KEY - XXXXXXXX', 'environment' => 'production' ]); Mothership::error($exception);
Laravel
Edit your app/Exceptions/Handler.php
file with the following and you're good to go.
use Illuminate\Support\Facades\App; use Mothership\Mothership; ... /** * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request * @param \Exception $exception * @return \Illuminate\Http\Response */ public function render($request, Exception $exception) { if ($this->shouldReport($exception)) { Mothership::init([ 'access_token' => 'XXXXXXXXX - YOUR KEY - XXXXXXXX', 'environment' => App::environment() ]); Mothership::error($exception); } parent::report($exception); }