You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2016/04/22 01:10:37 UTC

incubator-geode git commit: Add debugging

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1255 90db0cbe5 -> 682c7e93e


Add debugging


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

Branch: refs/heads/feature/GEODE-1255
Commit: 682c7e93e7377ffc3cde70776ffae2344f38329a
Parents: 90db0cb
Author: Kirk Lund <kl...@apache.org>
Authored: Thu Apr 21 16:10:26 2016 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Thu Apr 21 16:10:26 2016 -0700

----------------------------------------------------------------------
 .../com/gemstone/gemfire/distributed/LocatorLauncher.java     | 6 +++++-
 geode-core/src/main/resources/log4j2.xml                      | 2 +-
 .../gemfire/distributed/LocatorLauncherRemoteJUnitTest.java   | 7 +++++--
 ...g4j2_xml_MinimalistWithLocatorLauncherIntegrationTest.java | 4 ++++
 4 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/682c7e93/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
index 32e6bb2..2e997f3 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/LocatorLauncher.java
@@ -513,7 +513,11 @@ public final class LocatorLauncher extends AbstractLauncher<String> {
         case START:
           info(start());
           // KIRK:
-          LogService.getLogger().info("KIRK: isUsingGemFireDefaultConfig=" + LogService.isUsingGemFireDefaultConfig());
+          System.out.println("KIRK:LocatorLauncher:stdout: log4j.configurationFile=" + System.getProperty("log4j.configurationFile"));
+          System.out.println("KIRK:LocatorLauncher:stdout: isUsingGemFireDefaultConfig=" + LogService.isUsingGemFireDefaultConfig());
+
+          LogService.getLogger().info("KIRK:LocatorLauncher:log: log4j.configurationFile=" + System.getProperty("log4j.configurationFile"));
+          LogService.getLogger().info("KIRK:LocatorLauncher:log: isUsingGemFireDefaultConfig=" + LogService.isUsingGemFireDefaultConfig());
 //          if (LogService.isUsingGemFireDefaultConfig()) {
 //            throw new AssertionError("isUsingGemFireDefaultConfig");
 //          }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/682c7e93/geode-core/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/log4j2.xml b/geode-core/src/main/resources/log4j2.xml
index 55669fe..b300dc8 100755
--- a/geode-core/src/main/resources/log4j2.xml
+++ b/geode-core/src/main/resources/log4j2.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="DEBUG" shutdownHook="disable" packages="com.gemstone.gemfire.internal.logging.log4j">
+<Configuration status="TRACE" shutdownHook="disable" packages="com.gemstone.gemfire.internal.logging.log4j">
   <Properties>
     <Property name="gemfire-pattern">[%level{lowerCase=true} %date{yyyy/MM/dd HH:mm:ss.SSS z} &lt;%thread&gt; tid=%tid] %message%n%throwable%n</Property>
     <Property name="gemfire-default">true</Property>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/682c7e93/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
index b9025bb..7cf9087 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
@@ -213,6 +213,8 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
 
   @Test
   public void testStartUsesCustomLoggingConfiguration() throws Throwable {
+    // TODO: create working dir, copy custom xml to that dir and point log4j at it
+
     // build and start the locator
     final List<String> jvmArguments = getJvmArguments();
 
@@ -221,7 +223,8 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     for (String jvmArgument : jvmArguments) {
       command.add(jvmArgument);
     }
-    command.add("-D" + ConfigurationFactory.CONFIGURATION_FILE_PROPERTY + "=/Users/klund/dev/gemfire/open/geode-core/src/test/resources/com/gemstone/gemfire/internal/logging/log4j/custom/log4j2.xml");
+    command.add("-Dlog4j.configurationFile=/Users/klund/dev/gemfire/open/geode-core/src/test/resources/com/gemstone/gemfire/internal/logging/log4j/custom/log4j2.xml");
+    //command.add("-D" + ConfigurationFactory.CONFIGURATION_FILE_PROPERTY + "=/Users/klund/dev/doesnotexist.xml");
     command.add("-cp");
     command.add(System.getProperty("java.class.path"));
     command.add(LocatorLauncher.class.getName());
@@ -231,7 +234,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     command.add("--redirect-output");
 
     for (String line : command) {
-      System.out.println("KIRK: " + line);
+      System.out.println("KIRK:testStartUsesCustomLoggingConfiguration:stdout: " + line);
     }
 
     this.process = new ProcessBuilder(command).directory(this.temporaryFolder.getRoot()).start();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/682c7e93/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/custom/Custom_log4j2_xml_MinimalistWithLocatorLauncherIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/custom/Custom_log4j2_xml_MinimalistWithLocatorLauncherIntegrationTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/custom/Custom_log4j2_xml_MinimalistWithLocatorLauncherIntegrationTest.java
index 92a5608..f556f1f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/custom/Custom_log4j2_xml_MinimalistWithLocatorLauncherIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/custom/Custom_log4j2_xml_MinimalistWithLocatorLauncherIntegrationTest.java
@@ -96,6 +96,10 @@ public class Custom_log4j2_xml_MinimalistWithLocatorLauncherIntegrationTest {
 
   @Test
   public void foo() throws Exception {
+    System.out.println("KIRK:foo: customConfigFile=" + this.customConfigFile.getAbsolutePath());
+    System.setProperty("log4j.configurationFile", this.customConfigFile.getAbsolutePath());
+    System.out.println("KIRK:foo: log4j.configurationFile=" + System.getProperty("log4j.configurationFile"));
+
     LocatorLauncher launcher = new LocatorLauncher.Builder()
             .setCommand(LocatorLauncher.Command.START)
             .setMemberName("membername")