From: Benjamin Diaz Date: Tue, 28 Aug 2018 14:32:06 +0000 (-0300) Subject: Reduces kafka log level to WARN X-Git-Tag: v5.0.0~45^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F39%2F6439%2F2;p=osm%2FMON.git 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 --- 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...")