-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_logs.sh
executable file
·64 lines (46 loc) · 1.06 KB
/
docker_logs.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
# Utility to collect InifiniMetrics logs from self-hosted environment
show_help() {
cat <<EOF
Usage: $0 [options] --since <date>
Collect logs
Options:
-h, --help Show this message
--since Since when to start the logs collection [YYYY-MM-DD]
EOF
}
SINCE="${SINCE:-}"
while (($#)); do
case "$1" in
-h | --help)
show_help
exit
;;
--since)
SINCE="$2"
shift
shift
;;
*)
echo "Unexpected argument: $1. Use --help for usage information."
exit 1
;;
esac
shift
done
if [ -z "$SINCE" ]; then
show_help
exit 1
fi
echo "Starting collecting logs since $SINCE"
echo "=========================================="
echo "Docker process output:"
docker compose ps
echo "=========================================="
echo "Supervisor status:"
docker compose exec collect_stats supervisorctl status
echo "=========================================="
echo "Docker logs output:"
docker compose logs --since "$SINCE"
echo "=========================================="
echo "Logs collection ended."