定制 mothership-app/php-logs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

mothership-app/php-logs

Composer 安装命令:

composer require mothership-app/php-logs

包简介

Error logging library for Mothership.app

README 文档

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-11-06