From 178760622b46708ba71b376c3da40775a7b0936b Mon Sep 17 00:00:00 2001 From: mcilwain Date: Thu, 8 Feb 2018 12:46:12 -0800 Subject: [PATCH] Reduce console log spamminess in nomulus tool Every time you run nomulus tool you currently get a bunch of useless output to the console that looks like this: --- Feb 08, 2018 3:11:18 PM google.registry.config.YamlUtils mergeYaml INFO: Successfully loaded environment configuration YAML file. Feb 08, 2018 3:11:20 PM com.google.wrappers.base.GoogleInit logArgs INFO: First call to GoogleInit.initialize - removeFlags: false, args: [ProcessUtils, --noinstall_signal_handlers] Feb 08, 2018 3:11:20 PM com.google.wrappers.base.GoogleInit logArgs INFO: Subsequent call to GoogleInit.initialize, ignoring - removeFlags: false, args: [SecureWrapperBindings (via google.registry.tools.RegistryTool), --noinstall_signal_handlers] Feb 08, 2018 3:11:25 PM com.google.monitoring.metrics.MetricRegistryImpl newIncrementableMetric INFO: Registered new counter: /lock/acquire_lock_requests Feb 08, 2018 3:11:25 PM com.google.monitoring.metrics.MetricRegistryImpl newEventMetric INFO: Registered new event metric: /lock/lock_duration --- This CL fixes that by increasing the console logging threshold from INFO to WARNING for the relevant paths, for nomulus tool only. I also had to decrease the logging level of one statement inside YamlUtils from INFO to FINE, because it was being called by AppEngineConnectionFlags' constructor in building the HostAndPort server field, which is executed from the first line of RegistryCli.runCommand(), whereas loggingParams.configureLogging(), which actually reads in and takes action on the logging.properties file, isn't called until much later. This is fine though, because there's little value from logging the statement "Successfully loaded environment configuration YAML file." every time every command or flow is executed. We certainly do log errors if that ever fails, which is the important part. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=185036329 --- java/google/registry/config/YamlUtils.java | 4 ++-- java/google/registry/tools/logging.properties | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/java/google/registry/config/YamlUtils.java b/java/google/registry/config/YamlUtils.java index 255d00e6d..218f55fb1 100644 --- a/java/google/registry/config/YamlUtils.java +++ b/java/google/registry/config/YamlUtils.java @@ -92,9 +92,9 @@ public final class YamlUtils { Optional> customMap = loadAsMap(yaml, customYaml); if (customMap.isPresent()) { yamlMap = mergeMaps(yamlMap, customMap.get()); - logger.info("Successfully loaded environment configuration YAML file."); + logger.fine("Successfully loaded environment configuration YAML file."); } else { - logger.info("Ignoring empty environment configuration YAML file."); + logger.warning("Ignoring empty environment configuration YAML file."); } return yaml.dump(yamlMap); } diff --git a/java/google/registry/tools/logging.properties b/java/google/registry/tools/logging.properties index cc966263b..f724c987e 100644 --- a/java/google/registry/tools/logging.properties +++ b/java/google/registry/tools/logging.properties @@ -1,3 +1,5 @@ handlers = java.util.logging.ConsoleHandler .level = INFO +com.google.wrappers.base.GoogleInit.level = WARNING +com.google.monitoring.metrics.MetricRegistryImpl.level = WARNING