-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlogs.sh
More file actions
executable file
·59 lines (55 loc) · 1.19 KB
/
logs.sh
File metadata and controls
executable file
·59 lines (55 loc) · 1.19 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
51
52
53
54
55
56
57
58
#!/bin/bash
# Import ENV variables
set -o allexport
source .env
set +o allexport
if [ "$PLATFORM" = "podman" ]
then
CMD="podman logs"
SUFFIX="_1"
else
CMD="docker service logs"
SUFFIX=""
fi
case "$1" in
"db")
$CMD --tail 100 -f ${STACKNAME}_db${SUFFIX}
;;
"web")
$CMD --tail 100 -f ${STACKNAME}_web${SUFFIX}
;;
"ab")
$CMD --tail 100 -f ${STACKNAME}_appbuilder${SUFFIX}
;;
"sails")
$CMD --tail 500 -f ${STACKNAME}_api_sails${SUFFIX}
;;
"redis")
$CMD --tail 100 -f ${STACKNAME}_redis${SUFFIX}
;;
"pm")
$CMD --tail 100 -f ${STACKNAME}_process_manager${SUFFIX}
;;
"ne")
$CMD --tail 100 -f ${STACKNAME}_notification_email${SUFFIX}
;;
"system")
if [ "$PLATFORM" = "podman" ]
then
journalctl --user -u pod-${STACKNAME}.service -n 500 -f
else
node logs.js
fi
;;
*)
echo "Usage:"
echo " $0 db"
echo " $0 web"
echo " $0 ab"
echo " $0 sails"
echo " $0 redis"
echo " $0 pm"
echo " $0 ne"
echo " $0 system"
;;
esac