Repository: incubator-gobblin
Updated Branches:
  refs/heads/master 67ace96cc -> c111fa131


[GOBBLIN-192] Allow log4j configuration to be specified on command line

Currently, `GobblinAWSClusterManager` and
`GobblinAWSTaskRunner` hardcodes the log4j
configuration.  This PR allows
`log4j.configuration` to be specified on the
command line.  If so, it overrides the hardcoded
configuration.  This lets users bootstrap the AWS
cluster on their own without relying on
`GobblinAWSClusterLauncher`.

Closes #2043 from
kadaan/AllowOverrideOfLog4jConfig


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

Branch: refs/heads/master
Commit: c111fa13116c69416e4fd4535d56a1132f90387f
Parents: 67ace96
Author: Joel Baranick <joel.baran...@ensighten.com>
Authored: Thu Aug 10 23:05:36 2017 -0700
Committer: Abhishek Tiwari <abhishektiwari.bt...@gmail.com>
Committed: Thu Aug 10 23:05:36 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/gobblin/aws/GobblinAWSClusterManager.java  | 6 ++++--
 .../main/java/org/apache/gobblin/aws/GobblinAWSTaskRunner.java | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/c111fa13/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterManager.java
----------------------------------------------------------------------
diff --git 
a/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterManager.java
 
b/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterManager.java
index e18ca5b..17865df 100644
--- 
a/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterManager.java
+++ 
b/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSClusterManager.java
@@ -163,8 +163,10 @@ public class GobblinAWSClusterManager extends 
GobblinClusterManager {
         System.exit(1);
       }
 
-      
Log4jConfigHelper.updateLog4jConfiguration(GobblinAWSClusterManager.class,
-          GobblinAWSConfigurationKeys.GOBBLIN_AWS_LOG4J_CONFIGURATION_FILE);
+      if (System.getProperty("log4j.configuration") == null) {
+        
Log4jConfigHelper.updateLog4jConfiguration(GobblinAWSClusterManager.class,
+                
GobblinAWSConfigurationKeys.GOBBLIN_AWS_LOG4J_CONFIGURATION_FILE);
+      }
 
       LOGGER.info(JvmUtils.getJvmInputArguments());
 

http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/c111fa13/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSTaskRunner.java
----------------------------------------------------------------------
diff --git 
a/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSTaskRunner.java 
b/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSTaskRunner.java
index 93f36cf..cd2045f 100644
--- a/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSTaskRunner.java
+++ b/gobblin-aws/src/main/java/org/apache/gobblin/aws/GobblinAWSTaskRunner.java
@@ -178,8 +178,10 @@ public class GobblinAWSTaskRunner extends 
GobblinTaskRunner {
         System.exit(1);
       }
 
-      Log4jConfigHelper.updateLog4jConfiguration(GobblinTaskRunner.class,
-          GobblinAWSConfigurationKeys.GOBBLIN_AWS_LOG4J_CONFIGURATION_FILE);
+      if (System.getProperty("log4j.configuration") == null) {
+        Log4jConfigHelper.updateLog4jConfiguration(GobblinTaskRunner.class,
+                
GobblinAWSConfigurationKeys.GOBBLIN_AWS_LOG4J_CONFIGURATION_FILE);
+      }
 
       LOGGER.info(JvmUtils.getJvmInputArguments());
 

Reply via email to