tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject incubator-tinkerpop git commit: Moved logging setup to configuration.
Date Mon, 07 Dec 2015 16:31:52 GMT
Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-859 [created] b9efcb6a9


Moved logging setup to configuration.

Logging setup shouldn't be hardcoded anywhere especially since we use slf4j.  With this approach
the user has the ultimate control over what they want logged and what they don't.  TinkerPop
provides a sensible default in the provided logging properties files using log4j.


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

Branch: refs/heads/TINKERPOP-859
Commit: b9efcb6a99bf83e94f8db6a4612f0d92c23526cd
Parents: 8ab1bd3
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Mon Dec 7 11:29:49 2015 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Mon Dec 7 11:29:49 2015 -0500

----------------------------------------------------------------------
 gremlin-console/conf/log4j-console.properties        | 13 ++++++++-----
 gremlin-server/conf/log4j-server.properties          | 15 +++++++++------
 .../hadoop/groovy/plugin/HadoopGremlinPlugin.java    |  8 --------
 3 files changed, 17 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b9efcb6a/gremlin-console/conf/log4j-console.properties
----------------------------------------------------------------------
diff --git a/gremlin-console/conf/log4j-console.properties b/gremlin-console/conf/log4j-console.properties
index 09b5ef8..ea08fdf 100644
--- a/gremlin-console/conf/log4j-console.properties
+++ b/gremlin-console/conf/log4j-console.properties
@@ -15,9 +15,12 @@
 # specific language governing permissions and limitations
 # under the License.
 
-log4j.appender.A2=org.apache.log4j.ConsoleAppender
-log4j.appender.A2.Threshold=TRACE
-log4j.appender.A2.layout=org.apache.log4j.PatternLayout
-log4j.appender.A2.layout.ConversionPattern=%-5p %c %x - %m%n
+log4j.rootLogger=${gremlin.log4j.level}, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%-5p %c %x - %m%n
 
-log4j.rootLogger=${gremlin.log4j.level}, A2
+log4j.logger.org.apache.hadoop.mapred.JobClient=INFO
+log4j.logger.org.apache.hadoop.mapreduce.Job=INFO
+log4j.logger.org.apache.tinkerpop.gremlin.hadoop.process.computer.mapreduce.MapReduceGraphComputer=INFO
+log4j.logger.org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph=INFO
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b9efcb6a/gremlin-server/conf/log4j-server.properties
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/log4j-server.properties b/gremlin-server/conf/log4j-server.properties
index 2b6d9c0..f967d26 100644
--- a/gremlin-server/conf/log4j-server.properties
+++ b/gremlin-server/conf/log4j-server.properties
@@ -14,13 +14,16 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+
 log4j.rootLogger=INFO, stdout
-log4j.logger.org.apache.tinkerpop.gremlin.driver.Connection=OFF
-log4j.logger.org.apache.tinkerpop.gremlin.driver.ConnectionPool=OFF
-log4j.logger.org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph=ERROR
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-#log4j.appender.stdout=org.apache.log4j.FileAppender
-#log4j.appender.stdout.file=recless.log
-#log4j.appender.stdout.append=true
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=[%p] %C{1} - %m%n
+
+log4j.logger.org.apache.tinkerpop.gremlin.driver.Connection=OFF
+log4j.logger.org.apache.tinkerpop.gremlin.driver.ConnectionPool=OFF
+log4j.logger.org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jGraph=ERROR
+log4j.logger.org.apache.hadoop.mapred.JobClient=INFO
+log4j.logger.org.apache.hadoop.mapreduce.Job=INFO
+log4j.logger.org.apache.tinkerpop.gremlin.hadoop.process.computer.mapreduce.MapReduceGraphComputer=INFO
+log4j.logger.org.apache.tinkerpop.gremlin.hadoop.structure.HadoopGraph=INFO

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b9efcb6a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPlugin.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPlugin.java
b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPlugin.java
index d62b4e5..e8ed4c2 100644
--- a/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPlugin.java
+++ b/hadoop-gremlin/src/main/java/org/apache/tinkerpop/gremlin/hadoop/groovy/plugin/HadoopGremlinPlugin.java
@@ -20,8 +20,6 @@ package org.apache.tinkerpop.gremlin.hadoop.groovy.plugin;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.mapred.JobClient;
-import org.apache.hadoop.mapreduce.Job;
 import org.apache.tinkerpop.gremlin.groovy.plugin.AbstractGremlinPlugin;
 import org.apache.tinkerpop.gremlin.groovy.plugin.IllegalEnvironmentException;
 import org.apache.tinkerpop.gremlin.groovy.plugin.PluginAcceptor;
@@ -80,12 +78,6 @@ public final class HadoopGremlinPlugin extends AbstractGremlinPlugin {
     public void afterPluginTo(final PluginAcceptor pluginAcceptor) throws PluginInitializationException,
IllegalEnvironmentException {
         pluginAcceptor.addImports(IMPORTS);
         try {
-            pluginAcceptor.eval(String.format("Logger.getLogger(%s).setLevel(Level.INFO)",
JobClient.class.getName()));
-            pluginAcceptor.eval(String.format("Logger.getLogger(%s).setLevel(Level.INFO)",
Job.class.getName()));
-            ///
-            pluginAcceptor.eval(String.format("Logger.getLogger(%s).setLevel(Level.INFO)",
MapReduceGraphComputer.class.getName()));
-            ///
-            pluginAcceptor.eval(String.format("Logger.getLogger(%s).setLevel(Level.INFO)",
HadoopGraph.class.getName()));
             pluginAcceptor.eval(HadoopLoader.class.getCanonicalName() + ".load()");
 
             pluginAcceptor.addBinding("hdfs", FileSystem.get(new Configuration()));


Mime
View raw message