From a2a74d3467667f5cfd3f8e91edbf432df7dcc2d2 Mon Sep 17 00:00:00 2001 From: Benjamin Diaz Date: Tue, 28 Aug 2018 11:32:06 -0300 Subject: [PATCH] Reduces kafka log level to WARN Kafka was producing a considerable amount of logs, which in some cases caused disk space issues. Signed-off-by: Benjamin Diaz Change-Id: Id9a392ae881a8fff6ab8fe33b044370557adfeeb --- policy_module/osm_policy_module/cmd/policy_module_agent.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/policy_module/osm_policy_module/cmd/policy_module_agent.py b/policy_module/osm_policy_module/cmd/policy_module_agent.py index b9d6ca9..ac03167 100644 --- a/policy_module/osm_policy_module/cmd/policy_module_agent.py +++ b/policy_module/osm_policy_module/cmd/policy_module_agent.py @@ -55,6 +55,13 @@ def main(): root_logger = logging.getLogger() root_logger.addHandler(logstash.TCPLogstashHandler(logstash_host, logstash_port, version=1)) root_logger.info("Logstash handler configured.") + kafka_logger = logging.getLogger('kafka') + kafka_logger.setLevel(logging.WARN) + kafka_formatter = logging.Formatter( + '%(asctime)s - %(name)s - %(levelname)s - %(message)s') + kafka_handler = logging.StreamHandler(sys.stdout) + kafka_handler.setFormatter(kafka_formatter) + kafka_logger.addHandler(kafka_handler) log = logging.getLogger(__name__) log.info("Config: %s", cfg) log.info("Syncing database...") -- 2.25.1