Log to a file
This commit is contained in:
parent
f0aead5584
commit
7e01e88b9d
7
c66.bash
7
c66.bash
|
@ -27,10 +27,15 @@ cx_ssh() {
|
||||||
|
|
||||||
cx_log() {
|
cx_log() {
|
||||||
set_stack
|
set_stack
|
||||||
|
OUTPUT_FILE=$(mktemp)
|
||||||
|
echo "Logging to $OUTPUT_FILE"
|
||||||
SERVERS=$(cx servers list --stack $APPLICATION --environment $ENVIRONMENT | grep "\[.*$ROLE.*\]" | cut -d ' ' -f1)
|
SERVERS=$(cx servers list --stack $APPLICATION --environment $ENVIRONMENT | grep "\[.*$ROLE.*\]" | cut -d ' ' -f1)
|
||||||
for SERVER in ${SERVERS// /} ; do
|
for SERVER in ${SERVERS// /} ; do
|
||||||
cx tail --stack $APPLICATION --environment $ENVIRONMENT $SERVER $LOG_FILE &
|
echo "Following $LOG_FILE on $SERVER"
|
||||||
|
cx tail --stack $APPLICATION --environment $ENVIRONMENT $SERVER $LOG_FILE > ./$SERVER.log &
|
||||||
done
|
done
|
||||||
|
#tail -f $OUTPUT_FILE
|
||||||
|
#pkill cx
|
||||||
}
|
}
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|
Loading…
Reference in New Issue