• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

getsentry/sentry-laravel: Laravel SDK for Sentry

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

getsentry/sentry-laravel

开源软件地址(OpenSource Url):

https://github.com/getsentry/sentry-laravel

开源编程语言(OpenSource Language):

PHP 99.6%

开源软件介绍(OpenSource Introduction):

Sentry

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us Check out our open positions

Official Sentry SDK for Laravel

Build Status Composer page link -- version Discord

This is the official Laravel SDK for Sentry


Getting Started

The installation step below work on the latest versions of the Laravel framework (8.x and 9.x).

For other Laravel or Lumen versions see:

Install

Install the sentry/sentry-laravel package:

composer require sentry/sentry-laravel

Enable capturing unhandled exception to report to Sentry by making the following change to your App/Exceptions/Handler.php:

public function register()
{
    $this->reportable(function (Throwable $e) {
        if (app()->bound('sentry')) {
            app('sentry')->captureException($e);
        }
    });
}

Alternatively, you can configure Sentry in your Laravel Log Channel, allowing you to log info and debug as well.

Configure

Configure the Sentry DSN with this command:

php artisan sentry:publish --dsn=___PUBLIC_DSN___

It creates the config file (config/sentry.php) and adds the DSN to your .env file.

SENTRY_LARAVEL_DSN=___PUBLIC_DSN___

Usage

try {
    $this->functionFailsForSure();
} catch (\Throwable $exception) {
    \Sentry\captureException($exception);
}

Laravel Version Compatibility

  • Laravel <= 4.2.x is supported until 0.8.x
  • Laravel <= 5.7.x on PHP <= 7.0 is supported until 0.11.x
  • Laravel >= 5.x.x on PHP >= 7.1 is supported in all versions
  • Laravel >= 6.x.x on PHP >= 7.2 is supported starting from 1.2.0
  • Laravel >= 7.x.x on PHP >= 7.2 is supported starting from 1.7.0
  • Laravel >= 8.x.x on PHP >= 7.3 is supported starting from 1.9.0
  • Laravel >= 9.x.x on PHP >= 8.0 is supported starting from 2.11.0

Please note that of version >= 2.0.0 we require PHP Version >= 7.2 because we are using our new PHP SDK underneath.

Contributing to the SDK

Please refer to CONTRIBUTING.md.

Getting help/support

If you need help setting up or configuring the Laravel SDK (or anything else in the Sentry universe) please head over to the Sentry Community on Discord. There is a ton of great people in our Discord community ready to help you!

Resources

  • Documentation
  • Discord
  • Stack Overflow
  • Twitter Follow

License

Licensed under the Apache 2.0 license, see LICENSE




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap