From 7c39e385393c083dee2dc5bf42c1f5ea91b0db87 Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Mon, 4 Feb 2013 12:05:45 -0500 Subject: [PATCH] Defaulting service_variant to a blank string --- common/lib/logsettings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/lib/logsettings.py b/common/lib/logsettings.py index 6850941db7..8fc2bb9db1 100644 --- a/common/lib/logsettings.py +++ b/common/lib/logsettings.py @@ -40,6 +40,11 @@ def get_logger_config(log_dir, if console_loglevel is None or console_loglevel not in LOG_LEVELS: console_loglevel = 'DEBUG' if debug else 'INFO' + if service_variant is None: + # default to a blank string so that if SERVICE_VARIANT is not + # set we will not log to a sub directory + service_variant = '' + hostname = platform.node().split(".")[0] syslog_format = ("[service_variant={service_variant}]" "[%(name)s][env:{logging_env}] %(levelname)s "