From 88e5ee44165cd3c4d2ca36fca7dba4920d82a827 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Thu, 30 Oct 2014 15:25:12 +0530 Subject: [PATCH] Fix log --- src/lib/ee_lib_stack_packages.sh | 6 ++++++ src/lib/ee_lib_variables.sh | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lib/ee_lib_stack_packages.sh b/src/lib/ee_lib_stack_packages.sh index 332fd1f9..f5d97054 100644 --- a/src/lib/ee_lib_stack_packages.sh +++ b/src/lib/ee_lib_stack_packages.sh @@ -11,6 +11,12 @@ function ee_lib_stack_packages() if [ "$EE_PACKAGE_NAME" != "" ]; then # Export EE_DISPLAY variable to Display ee http auth after site creation. export EE_DISPLAY=false + + # Log only single time + # ee site create example.com called ee stack install nginx + # So in log file all logs written twice + export EE_LOG=false + # The following command creates its own sub-shell # and our ee_lib_error function only exit from that sub-shell # so we need to exit from parent shell also diff --git a/src/lib/ee_lib_variables.sh b/src/lib/ee_lib_variables.sh index 1d6eaf83..d74c65d1 100644 --- a/src/lib/ee_lib_variables.sh +++ b/src/lib/ee_lib_variables.sh @@ -18,7 +18,15 @@ readonly EE_VIMBADMIN_VERSION='3.0.10' # EasyEngine Date variable for backup readonly EE_DATE=$(date +%d%b%Y%H%M%S) -EE_COMMAND_LOG=/var/log/easyengine/ee.log +# Log only single time +# ee site create example.com called ee stack install nginx +# So in log file all logs written twice +if [ -n "$EE_LOG" ]; then + EE_COMMAND_LOG=/dev/null +else + EE_COMMAND_LOG=/var/log/easyengine/ee.log +fi + readonly EE_LOG_DIR=/var/log/easyengine readonly EE_ERROR_LOG=/var/log/easyengine/error.log readonly EE_LINUX_DISTRO=$(lsb_release -i |awk '{print $3}')