Repository: ambari
Updated Branches:
  refs/heads/trunk 0d2a6cbf2 -> 8056e25dc


AMBARI-9130 - Views: Run ambari-server using non-root causes issues with view 
instances (tbeerbower)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8056e25d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8056e25d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8056e25d

Branch: refs/heads/trunk
Commit: 8056e25dc330d4a8bb9e251014ab7f92c9bc7209
Parents: 0d2a6cb
Author: tbeerbower <[email protected]>
Authored: Wed Jan 14 14:39:02 2015 -0500
Committer: tbeerbower <[email protected]>
Committed: Wed Jan 14 14:39:13 2015 -0500

----------------------------------------------------------------------
 .../org/apache/ambari/server/controller/AmbariServer.java    | 8 ++++++++
 .../apache/ambari/server/controller/AmbariServerTest.java    | 7 +++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8056e25d/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
index 51f3a51..3a74bda 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
@@ -89,6 +89,7 @@ import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.utils.StageUtils;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.ambari.server.view.ViewRegistry;
+import org.apache.velocity.app.Velocity;
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.server.SessionIdManager;
@@ -127,6 +128,13 @@ import 
com.sun.jersey.spi.container.servlet.ServletContainer;
 public class AmbariServer {
   private static Logger LOG = LoggerFactory.getLogger(AmbariServer.class);
 
+  // Set velocity logger
+  protected static final String VELOCITY_LOG_CATEGORY = "VelocityLogger";
+
+  static {
+    Velocity.setProperty("runtime.log.logsystem.log4j.logger", 
VELOCITY_LOG_CATEGORY);
+  }
+
   private Server server = null;
 
   public volatile boolean running = true; // true while controller runs

http://git-wip-us.apache.org/repos/asf/ambari/blob/8056e25d/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java
index 8b7a641..3a0d3fd 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariServerTest.java
@@ -34,6 +34,7 @@ import org.apache.ambari.server.orm.GuiceJpaInitializer;
 import org.apache.ambari.server.orm.InMemoryDefaultTestModule;
 import org.apache.ambari.server.orm.dao.MetainfoDAO;
 import org.apache.ambari.server.orm.entities.MetainfoEntity;
+import org.apache.velocity.app.Velocity;
 import org.easymock.EasyMock;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.junit.After;
@@ -104,6 +105,12 @@ public class AmbariServerTest {
   }
 
   @Test
+  public void testVelocityLogger() throws Exception {
+    new AmbariServer();
+    Assert.assertEquals(AmbariServer.VELOCITY_LOG_CATEGORY, 
Velocity.getProperty("runtime.log.logsystem.log4j.logger"));
+  }
+
+  @Test
   public void testProxyUser() throws Exception {
 
     PasswordAuthentication pa = Authenticator.requestPasswordAuthentication(

Reply via email to