Revert "Allow setting of log level in config file"
Scott encountered a failure with this patch. Even though not in master,
it merits reverting to avert the possibility of instability during ONS.
We will recommit this in 1 week.
This reverts commit 9db725ac85631a479c9ea69f536ec501aa8a2c6f.
Change-Id: Ifb76c4218cda7379bdc0f016b665ce940462cdbd
diff --git a/xos/xos/logger.py b/xos/xos/logger.py
index 7ebf87c..1f57a4a 100644
--- a/xos/xos/logger.py
+++ b/xos/xos/logger.py
@@ -44,22 +44,14 @@
class Logger:
def __init__(self, logfile=None, loggername=None, level=logging.INFO):
- logstash_level = logging.DEBUG
- try:
- config_level = Config().observer_log_level
- if (config_level):
- level = getattr(logging, config_level)
- logstash_level = getattr(logging, config_level)
- except:
- pass
# Logstash config - try as specified explicitly in config
try:
logstash_host, logstash_port = Config().observer_logstash_hostport.split(':')
logstash_handler = logstash.LogstashHandler(
logstash_host, int(logstash_port), version=1)
-
- logstash_handler.setLevel(logstash_level)
+ # always log at DEBUG level to logstash
+ logstash_handler.setLevel(logging.DEBUG)
except:
logstash_handler = None
@@ -69,7 +61,7 @@
logstash_handler = logstash.LogstashHandler(
"cordloghost", 5617, version=1)
# always log at DEBUG level to logstash
- logstash_handler.setLevel(logstash_level)
+ logstash_handler.setLevel(logging.DEBUG)
except:
logstash_handler = None