You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by wf...@apache.org on 2014/10/17 04:04:18 UTC

git commit: Remove LogModule.

Repository: incubator-aurora
Updated Branches:
  refs/heads/master e339f18ca -> 3972ff6be


Remove LogModule.

Reviewed at https://reviews.apache.org/r/26849/


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

Branch: refs/heads/master
Commit: 3972ff6be26541e6d57ba5d40cacb5baa87b2e54
Parents: e339f18
Author: Bill Farner <wf...@apache.org>
Authored: Thu Oct 16 19:01:37 2014 -0700
Committer: Bill Farner <wf...@apache.org>
Committed: Thu Oct 16 19:01:37 2014 -0700

----------------------------------------------------------------------
 build.gradle                                      |  1 -
 .../aurora/scheduler/app/SchedulerMain.java       | 18 ++++++------------
 .../scheduler/http/JettyServerModuleTest.java     |  2 --
 3 files changed, 6 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/3972ff6b/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 26925df..f4352d2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -192,7 +192,6 @@ dependencies {
   }
   compile 'com.twitter.common:application-module-applauncher:0.0.51'
   compile 'com.twitter.common:application-module-lifecycle:0.0.48'
-  compile 'com.twitter.common:application-module-log:0.0.56'
   compile 'com.twitter.common:application-module-stats:0.0.44'
   compile 'com.twitter.common:application:0.0.73'
   compile 'com.twitter.common:args:0.2.9'

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/3972ff6b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
index 40b652c..0487409 100644
--- a/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
+++ b/src/main/java/org/apache/aurora/scheduler/app/SchedulerMain.java
@@ -15,7 +15,6 @@ package org.apache.aurora.scheduler.app;
 
 import java.net.InetSocketAddress;
 import java.util.List;
-import java.util.logging.Logger;
 
 import javax.inject.Inject;
 import javax.inject.Singleton;
@@ -30,7 +29,6 @@ import com.twitter.common.application.AbstractApplication;
 import com.twitter.common.application.AppLauncher;
 import com.twitter.common.application.Lifecycle;
 import com.twitter.common.application.modules.LocalServiceRegistry;
-import com.twitter.common.application.modules.LogModule;
 import com.twitter.common.application.modules.StatsModule;
 import com.twitter.common.args.Arg;
 import com.twitter.common.args.CmdLine;
@@ -65,13 +63,13 @@ import org.apache.aurora.scheduler.storage.mem.MemStorageModule;
 import org.apache.aurora.scheduler.thrift.ThriftModule;
 import org.apache.aurora.scheduler.thrift.auth.ThriftAuthModule;
 
+import static com.twitter.common.logging.RootLogConfig.Configuration;
+
 /**
  * Launcher for the aurora scheduler.
  */
 public class SchedulerMain extends AbstractApplication {
 
-  private static final Logger LOG = Logger.getLogger(SchedulerMain.class.getName());
-
   @NotNull
   @CmdLine(name = "cluster_name", help = "Name to identify the cluster being served.")
   private static final Arg<String> CLUSTER_NAME = Arg.create();
@@ -109,7 +107,6 @@ public class SchedulerMain extends AbstractApplication {
   @Inject private LocalServiceRegistry serviceRegistry;
   @Inject private SchedulerLifecycle schedulerLifecycle;
   @Inject private Lifecycle appLifecycle;
-  @Inject private Optional<RootLogConfig.Configuration> glogConfig;
 
   private static Iterable<? extends Module> getExtraModules() {
     Builder<Module> modules = ImmutableList.builder();
@@ -130,7 +127,6 @@ public class SchedulerMain extends AbstractApplication {
       String statsURLPrefix) {
 
     return ImmutableList.<Module>builder()
-        .add(new LogModule())
         .add(new StatsModule())
         .add(new AppModule(clusterName, serverSetPath, zkClientConfig, statsURLPrefix))
         .addAll(getExtraModules())
@@ -192,12 +188,10 @@ public class SchedulerMain extends AbstractApplication {
 
   @Override
   public void run() {
-    if (glogConfig.isPresent()) {
-      // Setup log4j to match our jul glog config in order to pick up zookeeper logging.
-      Log4jConfigurator.configureConsole(glogConfig.get());
-    } else {
-      LOG.warning("Running without expected glog configuration.");
-    }
+    // Setup log4j to match our jul glog config in order to pick up zookeeper logging.
+    Configuration logConfiguration = RootLogConfig.configurationFromFlags();
+    logConfiguration.apply();
+    Log4jConfigurator.configureConsole(logConfiguration);
 
     LeadershipListener leaderListener = schedulerLifecycle.prepare();
 

http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/3972ff6b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
index e24de79..1233b25 100644
--- a/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
+++ b/src/test/java/org/apache/aurora/scheduler/http/JettyServerModuleTest.java
@@ -33,7 +33,6 @@ import com.twitter.common.application.ShutdownRegistry.ShutdownRegistryImpl;
 import com.twitter.common.application.StartupRegistry;
 import com.twitter.common.application.modules.LifecycleModule;
 import com.twitter.common.application.modules.LocalServiceRegistry;
-import com.twitter.common.application.modules.LogModule;
 import com.twitter.common.application.modules.StatsModule;
 import com.twitter.common.base.Command;
 import com.twitter.common.net.pool.DynamicHostSet;
@@ -85,7 +84,6 @@ public abstract class JettyServerModuleTest extends EasyMockTest {
 
     injector = Guice.createInjector(
         new JettyServerModule(),
-        new LogModule(),
         new StatsModule(),
         new LifecycleModule(),
         new AbstractModule() {