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
This commit is contained in:
Dean Troyer 2015-01-29 12:05:43 -06:00
parent e605b39400
commit b43b359506

View File

@ -352,6 +352,10 @@ TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
LOGDAYS=${LOGDAYS:-7} LOGDAYS=${LOGDAYS:-7}
CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT") CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
if [[ -n ${LOGDIR:-} ]]; then
mkdir -p $LOGDIR
fi
if [[ -n "$LOGFILE" ]]; then if [[ -n "$LOGFILE" ]]; then
# Clean up old log files. Append '.*' to the user-specified # Clean up old log files. Append '.*' to the user-specified
# ``LOGFILE`` to match the date in the search template. # ``LOGFILE`` to match the date in the search template.