-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogs.sh
More file actions
37 lines (35 loc) · 1.04 KB
/
Copy pathlogs.sh
File metadata and controls
37 lines (35 loc) · 1.04 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
#!/bin/bash
# Stanford Students API - View Logs Script
echo "📝 Stanford Students API - Container Logs"
echo "========================================="
case "$1" in
"app"|"application")
echo "📱 Application Logs:"
docker logs -f stanford-app
;;
"db"|"database"|"postgres")
echo "🐘 PostgreSQL Logs:"
docker logs -f stanford-postgres
;;
"all"|"")
echo "📊 All Container Status:"
docker ps --filter "name=stanford-"
echo ""
echo "📱 Application Logs (last 20 lines):"
docker logs --tail 20 stanford-app
echo ""
echo "🐘 PostgreSQL Logs (last 10 lines):"
docker logs --tail 10 stanford-postgres
echo ""
echo "Usage: ./logs.sh [app|db|all]"
echo " app - Follow application logs"
echo " db - Follow database logs"
echo " all - Show recent logs from both (default)"
;;
*)
echo "Usage: ./logs.sh [app|db|all]"
echo " app - Follow application logs"
echo " db - Follow database logs"
echo " all - Show recent logs from both"
;;
esac