laravel - 如何确保哨兵正在捕获我的异常?
问题描述
我在一个新的 laravel 项目中实现了哨兵。发送测试异常似乎工作正常:
root@d816d48eed86:/app# php artisan sentry:test
[sentry] Client DSN discovered!
[sentry] Generating test event
[sentry] Sending test event
[sentry] Event sent with ID: d88ff2add86342989da27a8c75ec0562
我还可以看到哨兵网络服务器收到了它:
sentry_1 | 10.10.65.1 - - [12/Nov/2019:09:05:12 +0000] "POST /api/35/store/ HTTP/1.0" 200 366 "-" "sentry.php.laravel/1.4.1"
但是,异常从未出现在哨兵中。
我正在使用sentry/sentry-laravel
v1.4.1 包。
我该如何调试呢?
解决方案
事实证明,仅仅启动一个哨兵容器是不够的。您还必须启动运行 cron 和工作容器的容器:
sentry:
image: sentry:9
restart: unless-stopped
environment:
<<: *sentry-config
links:
- postgres
- memcached
- redis
ports:
- "9000"
cron:
image: sentry:9
links:
- redis
- postgres
command: "sentry run cron"
environment:
<<: *sentry-config
worker:
image: sentry
links:
- redis
- postgres
command: "sentry run worker"
environment:
<<: *sentry-config
postgres:
image: postgres:11
restart: unless-stopped
environment:
- POSTGRES_USER=sentry
- POSTGRES_DB=sentry
- POSTGRES_PASSWORD=sentry
redis:
image: redis:5-alpine
restart: unless-stopped
memcached:
image: memcached:1.5-alpine
restart: unless-stopped
推荐阅读
- javascript - .text() 和 .html() 在尝试使用cheerio、nodejs 抓取数据时返回空值
- c - C 文件中#include 的路径和给 GCC 的 -I 指令是否应该匹配?
- vue.js - 如何从 iframed 子应用程序访问父 Vue 应用程序的 Vuex 商店?
- python - 保存以 0 开头的数字时保留前导零
- node.js - 在 node.js 中侦听事件时“远程对等方断开连接”
- c++ - glm::mat4 构造函数如何工作?
- google-kubernetes-engine - 如何计算 GKE PVC IOPS
- javascript - 试图防止无效的按键(不是数字)和多个小数点
- c++ - 为什么 C++ 中的重命名函数不起作用?
- python - re_path 未解析的正则表达式 (\d[1,2])