geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [2/2] incubator-geode git commit: GEODE-37: fix up logging for org.apache.geode
Date Thu, 15 Sep 2016 23:03:22 GMT
GEODE-37: fix up logging for org.apache.geode

* change BASE_LOGGER_NAME to match MAIN_LOGGER_NAME
* change various instances of gemfire to geode
* change GEMFIRE_VERBOSE to GEODE_VERBOSE


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

Branch: refs/heads/develop
Commit: e138756280443ad0cd589a77ffcffab04e330b0b
Parents: fb2a7e3
Author: Kirk Lund <klund@apache.org>
Authored: Thu Sep 15 16:01:18 2016 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Thu Sep 15 16:03:12 2016 -0700

----------------------------------------------------------------------
 .../geode/internal/logging/LogService.java      | 11 ++---
 .../geode/internal/logging/log4j/LogMarker.java | 48 ++++++++++----------
 geode-core/src/main/resources/log4j2-cli.xml    |  6 ++-
 geode-core/src/main/resources/log4j2.xml        | 11 +++--
 .../internal/logging/log4j/log4j2-legacy.xml    |  6 ++-
 .../logging/log4j/custom/log4j2-custom.xml      |  5 +-
 .../apache/geode/test/golden/log4j2-test.xml    |  7 +--
 7 files changed, 50 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/geode-core/src/main/java/org/apache/geode/internal/logging/LogService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/logging/LogService.java b/geode-core/src/main/java/org/apache/geode/internal/logging/LogService.java
index a632b10..2c6eda3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/logging/LogService.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/logging/LogService.java
@@ -39,17 +39,16 @@ import org.apache.geode.internal.logging.log4j.message.GemFireParameterizedMessa
 
 /**
  * Centralizes log configuration and initialization.
- * 
  */
 @SuppressWarnings("unused")
 public class LogService extends LogManager {
-  // This is highest point in the hierarchy for all GemFire logging
+  // This is highest point in the hierarchy for all Geode logging
   public static final String ROOT_LOGGER_NAME = "";
-  public static final String BASE_LOGGER_NAME = "org.apache";
+  public static final String BASE_LOGGER_NAME = "org.apache.geode";
   public static final String MAIN_LOGGER_NAME = "org.apache.geode";
   public static final String SECURITY_LOGGER_NAME = "org.apache.geode.security";
   
-  public static final String GEMFIRE_VERBOSE_FILTER = "{GEMFIRE_VERBOSE}";
+  public static final String GEMFIRE_VERBOSE_FILTER = "{GEODE_VERBOSE}";
   
   protected static final String STDOUT = "STDOUT";
 
@@ -59,9 +58,9 @@ public class LogService extends LogManager {
   public static final String CLI_CONFIG = "/log4j2-cli.xml";
 
   /**
-   * Name of variable that is set to "true" in log4j2.xml to indicate that it is the default
gemfire config xml.
+   * Name of variable that is set to "true" in log4j2.xml to indicate that it is the default
geode config xml.
    */
-  private static final String GEMFIRE_DEFAULT_PROPERTY = "gemfire-default";
+  private static final String GEMFIRE_DEFAULT_PROPERTY = "geode-default";
   
   /** Protected by static synchronization. Used for removal and adding stdout back in. */
   private static Appender stdoutAppender;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogMarker.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogMarker.java
b/geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogMarker.java
index f5395ac..3c1eff8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogMarker.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogMarker.java
@@ -25,35 +25,35 @@ import org.apache.geode.DataSerializable;
 
 public interface LogMarker {
   /**
-   * GEMFIRE_VERBOSE is a parent to all other markers so that they can all be turned off
with<br>
-   * &ltMarkerFilter marker="GEMFIRE_VERBOSE" onMatch="DENY" onMismatch="NEUTRAL"/&gt
+   * GEODE_VERBOSE is a parent to all other markers so that they can all be turned off with<br>
+   * &ltMarkerFilter marker="GEODE_VERBOSE" onMatch="DENY" onMismatch="NEUTRAL"/&gt
    */
-  public static final Marker GEMFIRE_VERBOSE = MarkerManager.getMarker("GEMFIRE_VERBOSE");
+  public static final Marker GEODE_VERBOSE = MarkerManager.getMarker("GEODE_VERBOSE");
   
-  public static final Marker BRIDGE_SERVER = MarkerManager.getMarker("BRIDGE_SERVER").addParents(GEMFIRE_VERBOSE);
-  public static final Marker DLS = MarkerManager.getMarker("DLS").addParents(GEMFIRE_VERBOSE);
+  public static final Marker BRIDGE_SERVER = MarkerManager.getMarker("BRIDGE_SERVER").addParents(GEODE_VERBOSE);
+  public static final Marker DLS = MarkerManager.getMarker("DLS").addParents(GEODE_VERBOSE);
   
-  public static final Marker PERSIST = MarkerManager.getMarker("PERSIST").addParents(GEMFIRE_VERBOSE);
+  public static final Marker PERSIST = MarkerManager.getMarker("PERSIST").addParents(GEODE_VERBOSE);
   public static final Marker PERSIST_VIEW = MarkerManager.getMarker("PERSIST_VIEW").addParents(PERSIST);
   public static final Marker PERSIST_ADVISOR = MarkerManager.getMarker("PERSIST_ADVISOR").addParents(PERSIST);
   public static final Marker PERSIST_RECOVERY = MarkerManager.getMarker("PERSIST_RECOVERY").addParents(PERSIST);
   public static final Marker PERSIST_WRITES = MarkerManager.getMarker("PERSIST_WRITES").addParents(PERSIST);
   
-  public static final Marker TOMBSTONE = MarkerManager.getMarker("TOMBSTONE").addParents(GEMFIRE_VERBOSE);
+  public static final Marker TOMBSTONE = MarkerManager.getMarker("TOMBSTONE").addParents(GEODE_VERBOSE);
   public static final Marker TOMBSTONE_COUNT = MarkerManager.getMarker("TOMBSTONE_COUNT").addParents(TOMBSTONE);
   
-  public static final Marker LRU = MarkerManager.getMarker("LRU").addParents(GEMFIRE_VERBOSE);
+  public static final Marker LRU = MarkerManager.getMarker("LRU").addParents(GEODE_VERBOSE);
   public static final Marker LRU_TOMBSTONE_COUNT = MarkerManager.getMarker("LRU_TOMBSTONE_COUNT").addParents(LRU,
TOMBSTONE_COUNT);
   public static final Marker LRU_CLOCK = MarkerManager.getMarker("LRU_CLOCK").addParents(LRU);
   
-  public static final Marker RVV = MarkerManager.getMarker("RVV").addParents(GEMFIRE_VERBOSE);
-  public static final Marker VERSION_TAG = MarkerManager.getMarker("VERSION_TAG").addParents(GEMFIRE_VERBOSE);
// gemfire.VersionTag.DEBUG
-  public static final Marker VERSIONED_OBJECT_LIST = MarkerManager.getMarker("VERSIONED_OBJECT_LIST").addParents(GEMFIRE_VERBOSE);
// gemfire.VersionedObjectList.DEBUG
+  public static final Marker RVV = MarkerManager.getMarker("RVV").addParents(GEODE_VERBOSE);
+  public static final Marker VERSION_TAG = MarkerManager.getMarker("VERSION_TAG").addParents(GEODE_VERBOSE);
// gemfire.VersionTag.DEBUG
+  public static final Marker VERSIONED_OBJECT_LIST = MarkerManager.getMarker("VERSIONED_OBJECT_LIST").addParents(GEODE_VERBOSE);
// gemfire.VersionedObjectList.DEBUG
 
   // cache.tier.sockets
-  public static final Marker OBJECT_PART_LIST = MarkerManager.getMarker("OBJECT_PART_LIST").addParents(GEMFIRE_VERBOSE);
// gemfire.ObjectPartList.DEBUG
+  public static final Marker OBJECT_PART_LIST = MarkerManager.getMarker("OBJECT_PART_LIST").addParents(GEODE_VERBOSE);
// gemfire.ObjectPartList.DEBUG
   
-  public static final Marker SERIALIZER = MarkerManager.getMarker("SERIALIZER").addParents(GEMFIRE_VERBOSE);
// DataSerializer.DEBUG
+  public static final Marker SERIALIZER = MarkerManager.getMarker("SERIALIZER").addParents(GEODE_VERBOSE);
// DataSerializer.DEBUG
   /** If the <code>"DataSerializer.DUMP_SERIALIZED"</code> system
    * property is set, the class names of the objects that are
    * serialized by {@link org.apache.geode.DataSerializer#writeObject(Object, DataOutput)}
using standard Java
@@ -65,10 +65,10 @@ public interface LogMarker {
   public static final Marker TRACE_SERIALIZABLE = MarkerManager.getMarker("TRACE_SERIALIZABLE").addParents(SERIALIZER);
// DataSerializer.TRACE_SERIALIZABLE
   public static final Marker DEBUG_DSFID = MarkerManager.getMarker("DEBUG_DSFID").addParents(SERIALIZER);
// DataSerializer.DEBUG_DSFID
   
-  public static final Marker STATISTICS = MarkerManager.getMarker("STATISTICS").addParents(GEMFIRE_VERBOSE);
-  public static final Marker STATE_FLUSH_OP = MarkerManager.getMarker("STATE_FLUSH_OP").addParents(GEMFIRE_VERBOSE);
+  public static final Marker STATISTICS = MarkerManager.getMarker("STATISTICS").addParents(GEODE_VERBOSE);
+  public static final Marker STATE_FLUSH_OP = MarkerManager.getMarker("STATE_FLUSH_OP").addParents(GEODE_VERBOSE);
   
-  public static final Marker DISTRIBUTION = MarkerManager.getMarker("DISTRIBUTION").addParents(GEMFIRE_VERBOSE);
+  public static final Marker DISTRIBUTION = MarkerManager.getMarker("DISTRIBUTION").addParents(GEODE_VERBOSE);
   public static final Marker DISTRIBUTION_STATE_FLUSH_OP = MarkerManager.getMarker("DISTRIBUTION_STATE_FLUSH_OP").addParents(DISTRIBUTION,
STATE_FLUSH_OP);
   public static final Marker DISTRIBUTION_BRIDGE_SERVER = MarkerManager.getMarker("DISTRIBUTION_BRIDGE_SERVER").addParents(DISTRIBUTION,
BRIDGE_SERVER);
   public static final Marker DISTRIBUTION_VIEWS = MarkerManager.getMarker("DISTRIBUTION_VIEWS").addParents(DISTRIBUTION);
@@ -76,23 +76,23 @@ public interface LogMarker {
   public static final Marker DM_BRIDGE_SERVER = MarkerManager.getMarker("DM_BRIDGE").addParents(BRIDGE_SERVER,
DM);
   public static final Marker DA = MarkerManager.getMarker("DA").addParents(DISTRIBUTION);
 
-  public static final Marker GII = MarkerManager.getMarker("GII").addParents(GEMFIRE_VERBOSE);
+  public static final Marker GII = MarkerManager.getMarker("GII").addParents(GEODE_VERBOSE);
   public static final Marker GII_VERSIONED_ENTRY = MarkerManager.getMarker("GII_VERSION_ENTRY").addParents(GII);
   
-  public static final Marker JGROUPS = MarkerManager.getMarker("JGROUPS").addParents(GEMFIRE_VERBOSE);
+  public static final Marker JGROUPS = MarkerManager.getMarker("JGROUPS").addParents(GEODE_VERBOSE);
   
-  public static final Marker QA = MarkerManager.getMarker("QA").addParents(GEMFIRE_VERBOSE);
+  public static final Marker QA = MarkerManager.getMarker("QA").addParents(GEODE_VERBOSE);
   
-  public static final Marker P2P = MarkerManager.getMarker("P2P").addParents(GEMFIRE_VERBOSE);
+  public static final Marker P2P = MarkerManager.getMarker("P2P").addParents(GEODE_VERBOSE);
   
   public static final Marker CONFIG = MarkerManager.getMarker("CONFIG");
   
-  public static final Marker PERSISTENCE = MarkerManager.getMarker("PERSISTENCE").addParents(GEMFIRE_VERBOSE);
+  public static final Marker PERSISTENCE = MarkerManager.getMarker("PERSISTENCE").addParents(GEODE_VERBOSE);
   public static final Marker DISK_STORE_MONITOR = MarkerManager.getMarker("DISK_STORE_MONITOR").addParents(PERSISTENCE);
   public static final Marker SOPLOG = MarkerManager.getMarker("SOPLOG").addParents(PERSISTENCE);
   
-  public static final Marker MANAGED_ENTITY = MarkerManager.getMarker("MANAGED_ENTITY").addParents(GEMFIRE_VERBOSE);
+  public static final Marker MANAGED_ENTITY = MarkerManager.getMarker("MANAGED_ENTITY").addParents(GEODE_VERBOSE);
   
-  public static final Marker CACHE_XML = MarkerManager.getMarker("CACHE_XML").addParents(GEMFIRE_VERBOSE);
-  public static final Marker CACHE_XML_PARSER = MarkerManager.getMarker("CACHE_XML_PARSER").addParents(GEMFIRE_VERBOSE,
CACHE_XML);
+  public static final Marker CACHE_XML = MarkerManager.getMarker("CACHE_XML").addParents(GEODE_VERBOSE);
+  public static final Marker CACHE_XML_PARSER = MarkerManager.getMarker("CACHE_XML_PARSER").addParents(GEODE_VERBOSE,
CACHE_XML);
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/geode-core/src/main/resources/log4j2-cli.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/log4j2-cli.xml b/geode-core/src/main/resources/log4j2-cli.xml
index a4e9b27..81b3333 100644
--- a/geode-core/src/main/resources/log4j2-cli.xml
+++ b/geode-core/src/main/resources/log4j2-cli.xml
@@ -1,15 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Configuration status="FATAL" shutdownHook="disable" packages="org.apache.geode.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="geode-pattern">[%level{lowerCase=true} %date{yyyy/MM/dd HH:mm:ss.SSS
z} &lt;%thread&gt; tid=%tid] %message%n%throwable%n</Property>
   </Properties>
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
-      <PatternLayout pattern="${gemfire-pattern}"/>
+      <PatternLayout pattern="${geode-pattern}"/>
     </Console>
   </Appenders>
   <Loggers>
     <Logger name="com.gemstone" level="WARN" additivity="true"/>
+    <Logger name="org.apache.geode" level="WARN" additivity="true"/>
+    <Logger name="org.jgroups" level="FATAL" additivity="true"/>
     <Root level="WARN">
       <AppenderRef ref="STDOUT"/>
     </Root>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/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 710919e..cdb932b 100755
--- a/geode-core/src/main/resources/log4j2.xml
+++ b/geode-core/src/main/resources/log4j2.xml
@@ -1,18 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Configuration status="FATAL" shutdownHook="disable" packages="org.apache.geode.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>
+    <Property name="geode-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="geode-default">true</Property>
   </Properties>
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
-      <PatternLayout pattern="${gemfire-pattern}"/>
+      <PatternLayout pattern="${geode-pattern}"/>
     </Console>
   </Appenders>
   <Loggers>
-    <Logger name="com.gemstone" level="INFO" additivity="true">
+    <Logger name="com.gemstone" level="INFO" additivity="true"/>
+    <Logger name="org.apache.geode" level="INFO" additivity="true">
     <filters>
-      <MarkerFilter marker="GEMFIRE_VERBOSE" onMatch="DENY" onMismatch="NEUTRAL"/>
+      <MarkerFilter marker="GEODE_VERBOSE" onMatch="DENY" onMismatch="NEUTRAL"/>
     </filters>
     </Logger>
     <Logger name="org.jgroups" level="FATAL" additivity="true"/>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/geode-core/src/main/resources/org/apache/geode/internal/logging/log4j/log4j2-legacy.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/main/resources/org/apache/geode/internal/logging/log4j/log4j2-legacy.xml
b/geode-core/src/main/resources/org/apache/geode/internal/logging/log4j/log4j2-legacy.xml
index 1758573..15aeecf 100644
--- a/geode-core/src/main/resources/org/apache/geode/internal/logging/log4j/log4j2-legacy.xml
+++ b/geode-core/src/main/resources/org/apache/geode/internal/logging/log4j/log4j2-legacy.xml
@@ -1,15 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Configuration status="FATAL" shutdownHook="disable" packages="org.apache.geode.internal.logging.log4j">
   <Properties>
-    <Property name="gemfire-pattern">[%level{FATAL=severe,ERROR=error,WARN=warning,INFO=info,DEBUG=fine,TRACE=finest}
%date{yyyy/MM/dd HH:mm:ss.SSS z} &lt;%thread&gt; tid=%tid] %message%n%throwable%n</Property>
+    <Property name="geode-pattern">[%level{FATAL=severe,ERROR=error,WARN=warning,INFO=info,DEBUG=fine,TRACE=finest}
%date{yyyy/MM/dd HH:mm:ss.SSS z} &lt;%thread&gt; tid=%tid] %message%n%throwable%n</Property>
   </Properties>
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
-      <PatternLayout pattern="${gemfire-pattern}"/>
+      <PatternLayout pattern="${geode-pattern}"/>
     </Console>
   </Appenders>
   <Loggers>
     <Logger name="com.gemstone" level="WARN" additivity="true"/>
+    <Logger name="org.apache.geode" level="WARN" additivity="true"/>
+    <Logger name="org.jgroups" level="FATAL" additivity="true"/>
     <Root level="WARN">
       <AppenderRef ref="STDOUT"/>
     </Root>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/geode-core/src/test/resources/org/apache/geode/internal/logging/log4j/custom/log4j2-custom.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/internal/logging/log4j/custom/log4j2-custom.xml
b/geode-core/src/test/resources/org/apache/geode/internal/logging/log4j/custom/log4j2-custom.xml
index 37180bb..8ab555f 100644
--- a/geode-core/src/test/resources/org/apache/geode/internal/logging/log4j/custom/log4j2-custom.xml
+++ b/geode-core/src/test/resources/org/apache/geode/internal/logging/log4j/custom/log4j2-custom.xml
@@ -12,13 +12,14 @@
         </Basic>
     </Appenders>
     <Loggers>
-        <Logger name="com.gemstone" level="INFO" additivity="true">
+        <Logger name="com.gemstone" level="INFO" additivity="true"/>
+        <Logger name="org.apache.geode" level="INFO" additivity="true">
             <filters>
                 <MarkerFilter marker="GEMFIRE_VERBOSE" onMatch="DENY" onMismatch="NEUTRAL"/>
             </filters>
         </Logger>
-        <Logger name="org.jgroups" level="FATAL" additivity="true"/>
         <Logger name="org.apache.geode.internal.logging.log4j.custom" level="DEBUG" additivity="true"/>
+        <Logger name="org.jgroups" level="FATAL" additivity="true"/>
         <Root level="INFO">
             <AppenderRef ref="CUSTOM"/>
             <AppenderRef ref="STDOUT"/>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e1387562/geode-core/src/test/resources/org/apache/geode/test/golden/log4j2-test.xml
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/org/apache/geode/test/golden/log4j2-test.xml b/geode-core/src/test/resources/org/apache/geode/test/golden/log4j2-test.xml
index cad5cb5..5608e91 100755
--- a/geode-core/src/test/resources/org/apache/geode/test/golden/log4j2-test.xml
+++ b/geode-core/src/test/resources/org/apache/geode/test/golden/log4j2-test.xml
@@ -1,15 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="ERROR" shutdownHook="disable" packages="com.gemstone.org.apache.logging.log4j.core.config.xml,org.apache.geode.internal.logging.log4j">
+<Configuration status="ERROR" shutdownHook="disable" packages="org.apache.geode.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="geode-pattern">[%level{lowerCase=true} %date{yyyy/MM/dd HH:mm:ss.SSS
z} &lt;%thread&gt; tid=%tid] %message%n%throwable%n</Property>
   </Properties>
   <Appenders>
     <Console name="STDOUT" target="SYSTEM_OUT">
-      <PatternLayout pattern="${gemfire-pattern}"/>
+      <PatternLayout pattern="${geode-pattern}"/>
     </Console>
   </Appenders>
   <Loggers>
     <Logger name="com.gemstone" level="WARN" additivity="true"/>
+    <Logger name="org.apache.geode" level="WARN" additivity="true"/>
     <Logger name="quickstart" level="WARN" additivity="true"/>
     <Root level="ERROR">
       <AppenderRef ref="STDOUT"/>


Mime
View raw message