-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebhook-inspector.sh
More file actions
50 lines (39 loc) · 1.37 KB
/
Copy pathwebhook-inspector.sh
File metadata and controls
50 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Script para inspeccionar webhooks de WhatsApp en los logs
# Uso: ./webhook-inspector.sh
echo "=================================="
echo "WhatsApp Webhook Inspector"
echo "=================================="
echo ""
# Colores para output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
LOG_FILE="storage/logs/laravel.log"
if [ ! -f "$LOG_FILE" ]; then
echo -e "${RED}Error: Log file not found: $LOG_FILE${NC}"
exit 1
fi
echo -e "${YELLOW}🔍 Buscando webhooks recientes...${NC}"
echo ""
# Buscar últimas 5 entradas de EventPushController
echo -e "${YELLOW}📨 Últimos webhooks recibidos:${NC}"
grep "EventPushController::push()" "$LOG_FILE" | tail -n 5
echo ""
echo -e "${YELLOW}📊 Eventos procesados:${NC}"
grep "ProcessExternalMessageEvent::handle()" "$LOG_FILE" | tail -n 5
echo ""
echo -e "${YELLOW}✅ Mensajes creados:${NC}"
grep "Mensaje creado desde ExternalEvent" "$LOG_FILE" | tail -n 5
echo ""
echo -e "${YELLOW}⚠️ Errores:${NC}"
grep -i "error\|exception" "$LOG_FILE" | grep -i "external\|webhook" | tail -n 5
echo ""
echo "=================================="
echo "Para ver el log completo:"
echo " tail -f storage/logs/laravel.log"
echo ""
echo "Para filtrar solo webhooks:"
echo " tail -f storage/logs/laravel.log | grep -E 'EventPushController|ProcessExternalMessageEvent'"
echo "=================================="