1. 准备环境
docker docker-compose
2. 安装
a. docker-compose git clonegit clone https://github.com/getsentry/onpremise.gitb. create keydocker-compose run --rm web config generate-secret-keyc. 修改docker-compose 使用b 中的key 替换 docker-compose.yml 文件的 SENTRY_SECRET_KEY 项,并取消 SENTRY_SECRET_KEY 项的注释d. 初始化数据库docker-compose run --rm web upgrade其中会帮助我们生成用户账户e. 登陆进行配置比较简单,按照自实际情况即可
https://github.com/getsentry/onpremise
3. 使用
a. 创建project本次选择的是nodejs,同时会帮助我们生成对应的代码,拷贝即可b. 创建nodejs 项目 yarn init yarn add raven 项目结构如下: ├── README.md ├── app.js ├── package.json └── yarn.lock app.js const Raven = require('raven'); Raven.config('http://xxxxxxxxxxx').install(); function userSearch(username){ console.log("usersearch is call"); throw new Error("username is not validate ") } try { userSearch("dalong"); } catch (e) { Raven.captureException(e); }
4. 效果
如下图,总的来说还是比较方便的
5. 参考资料
https://sentry.io/welcome/https://github.com/getsentry/onpremise