From b43b3595061ce3138889ac78ded0eebbb144e4db Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 29 Jan 2015 12:05:43 -0600 Subject: [PATCH] Create LOGDIR if it doesn't exist Create LOGDIR when LOGFILE is not set. This fix is rather blunt as logging setup will be further tweaked as https://github.com/openstack/qa-specs/blob/master/specs/devstack/devstack-logging-and-service-names.rst progresses. Change-Id: I4a574f295eb6d55c7196ec563bd356d6c0bc8833 --- stack.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stack.sh b/stack.sh index 5b5697252b..d3d54cc699 100755 --- a/stack.sh +++ b/stack.sh @@ -352,6 +352,10 @@ TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"} LOGDAYS=${LOGDAYS:-7} CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT") +if [[ -n ${LOGDIR:-} ]]; then + mkdir -p $LOGDIR +fi + if [[ -n "$LOGFILE" ]]; then # Clean up old log files. Append '.*' to the user-specified # ``LOGFILE`` to match the date in the search template.