我如何确保哨兵正在捕获我的异常



我在一个新的laravel项目中实现了sentry。发送测试异常似乎运行良好:

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-laravelv1.4.1软件包。

如何调试?

事实证明,仅仅启动一个哨兵容器是不够的。您还必须旋转运行cron和worker容器的容器:

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

最新更新