geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zho...@apache.org
Subject [07/46] geode git commit: GEODE-2601: Fixing banner being logged twice during locator startup.
Date Tue, 27 Jun 2017 05:00:22 GMT
GEODE-2601: Fixing banner being logged twice during locator startup.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/2d3e05ec
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/2d3e05ec
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/2d3e05ec

Branch: refs/heads/feature/GEM-1483
Commit: 2d3e05ecedf724af8d413f50567afc7f9a87e343
Parents: 3154424
Author: YehEmily <emilyyeh1997@gmail.com>
Authored: Mon Jun 12 13:55:24 2017 -0700
Committer: Ken Howe <khowe@pivotal.io>
Committed: Mon Jun 19 09:52:13 2017 -0700

----------------------------------------------------------------------
 .../internal/InternalDistributedSystem.java     | 24 ++++++++++++
 .../distributed/internal/InternalLocator.java   | 41 ++++++++++----------
 .../internal/logging/LogWriterFactory.java      | 20 ++++------
 3 files changed, 53 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/2d3e05ec/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index d77e8b9..4ed58af 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -18,6 +18,30 @@ package org.apache.geode.distributed.internal;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 import static org.apache.geode.distributed.ConfigurationProperties.MCAST_PORT;
 
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.lang.reflect.Array;
+import java.net.InetAddress;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.StringTokenizer;
+import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicReference;
+
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.CancelException;
 import org.apache.geode.ForcedDisconnectException;

http://git-wip-us.apache.org/repos/asf/geode/blob/2d3e05ec/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
index ae548c4..3ff27ea 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java
@@ -18,7 +18,24 @@ import static org.apache.geode.distributed.ConfigurationProperties.BIND_ADDRESS;
 import static org.apache.geode.distributed.ConfigurationProperties.CACHE_XML_FILE;
 import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;
 
+import java.io.File;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
 import org.apache.commons.lang.StringUtils;
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.CancelException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.GemFireCache;
@@ -65,22 +82,6 @@ import org.apache.geode.management.internal.configuration.handlers.SharedConfigu
 import org.apache.geode.management.internal.configuration.messages.ConfigurationRequest;
 import org.apache.geode.management.internal.configuration.messages.SharedConfigurationStatusRequest;
 import org.apache.geode.management.internal.configuration.messages.SharedConfigurationStatusResponse;
-import org.apache.logging.log4j.Logger;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * Provides the implementation of a distribution {@code Locator} as well as internal-only
@@ -469,17 +470,17 @@ public class InternalLocator extends Locator implements ConnectListener
{
         LogWriterAppenders.getOrCreateAppender(LogWriterAppenders.Identifier.SECURITY, true,
false,
             this.config, false);
 
-      } else {
-        // do not create a LogWriterAppender for security -- let it go through to logWriterAppender
       }
+        // do not create a LogWriterAppender for security -- let it go through to logWriterAppender
     }
 
     // LOG: create LogWriters for GemFireTracer (or use whatever was passed in)
     if (logWriter == null) {
       logWriter = LogWriterFactory.createLogWriterLogger(false, false, this.config,
-          !startDistributedSystem);
-      if (logger.isDebugEnabled())
+          false);
+      if (logger.isDebugEnabled()) {
         logger.debug("LogWriter for locator is created.");
+      }
     }
 
     if (securityLogWriter == null) {

http://git-wip-us.apache.org/repos/asf/geode/blob/2d3e05ec/geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterFactory.java
b/geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterFactory.java
index c4fecfd..4202afd 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterFactory.java
@@ -14,7 +14,7 @@
  */
 package org.apache.geode.internal.logging;
 
-import static org.apache.geode.distributed.ConfigurationProperties.*;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
 
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
@@ -79,16 +79,13 @@ public class LogWriterFactory {
     }
 
     // log the banner
-    if (!Boolean.getBoolean(InternalLocator.INHIBIT_DM_BANNER)) {
-      if (InternalDistributedSystem.getReconnectAttemptCounter() == 0 // avoid filling up
logs
-                                                                      // during auto-reconnect
-          && !isSecure // && !isLoner /* do this on a loner to fix bug 35602
*/
-      ) {
-        // LOG:CONFIG:
-        logger.info(LogMarker.CONFIG, Banner.getString(null));
-      }
-      System.setProperty(InternalLocator.INHIBIT_DM_BANNER, "true"); // Ensure no more banners
will
-                                                                     // be logged
+    if (!Boolean.getBoolean(InternalLocator.INHIBIT_DM_BANNER)
+        && InternalDistributedSystem.getReconnectAttemptCounter() == 0 // avoid filling
up logs
+                                                                       // during auto-reconnect
+        && !isSecure // && !isLoner /* do this on a loner to fix bug 35602
*/
+        && logConfig) {
+      // LOG:CONFIG:
+      logger.info(LogMarker.CONFIG, Banner.getString(null));
     } else {
       logger.debug("skipping banner - " + InternalLocator.INHIBIT_DM_BANNER + " is set to
true");
     }
@@ -101,7 +98,6 @@ public class LogWriterFactory {
               LocalizedStrings.InternalDistributedSystem_STARTUP_CONFIGURATIONN_0,
               config.toLoggerString()));
     }
-
     return logger;
   }
 }


Mime
View raw message