Skip to content

MothershipApp/php-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mothership PHP Logs

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);
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages