mati-core/sentry

MatiCore 的 Sentry

v1.0.2 2021-05-05 10:12 UTC

This package is auto-updated.

Last update: 2024-09-05 17:32:20 UTC


README

Latest Stable Version Total Downloads Integrity check Latest Unstable Version License

安装

Composer 命令

composer require mati-core/sentry

配置

sentry:
    dsn: null # required DNS from sentry.io
    environment: local # optional <local | production>
    release: 'project-name@version'
    user_fields: [] # optional values <website id>
    priority_mapping: [] #custom priorities mapping customeName: debug|info|warning|error|fatal

浏览器设置

在你的资源目录中创建一个名为 sentry.js 的 JS 文件

Sentry.init({
	dsn: "your-dsn.sentry.io",
	release: "project-name@version",
	integrations: [new Sentry.Integrations.BrowserTracing()],
	tracesSampleRate: 1.0,
});

在你的布局中包含文件

<script src="https://#/6.3.5/bundle.tracing.min.js"
		integrity="sha384-0RpBr4PNjUAqckh8BtmPUuFGNC082TAztkL1VE2ttmtsYJBUvqcZbThnfE5On6h1"
		crossOrigin="anonymous"></script>
<script src="{$basePath}/assets/js/sentry.js"></script>

使用

哈哈,很简单!使用 Tracy 或用户浏览器捕获的每个异常都将自动发送到 sentry.io 中的问题。

更多信息: https://sentry.io