You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2012/10/03 06:22:20 UTC
svn commit: r1393285 - in /incubator/ambari/branches/AMBARI-666:
AMBARI-666-CHANGES.txt ambari-server/conf/log4j.properties
ambari-server/src/main/assemblies/server.xml
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
Author: mahadev
Date: Wed Oct 3 04:22:19 2012
New Revision: 1393285
URL: http://svn.apache.org/viewvc?rev=1393285&view=rev
Log:
AMBARI-794. Add log4j properties for logging at the server. (mahadev)
Modified:
incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/assemblies/server.xml
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1393285&r1=1393284&r2=1393285&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Oct 3 04:22:19 2012
@@ -12,6 +12,8 @@ AMBARI-666 branch (unreleased changes)
NEW FEATURES
+ AMBARI-794. Add log4j properties for logging at the server. (mahadev)
+
AMBARI-790. OK in registration response. (jitendra)
AMBARI-789. Prototype for management spi interface. (hitesh)
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties?rev=1393285&r1=1393284&r2=1393285&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/conf/log4j.properties Wed Oct 3 04:22:19 2012
@@ -1,28 +1,21 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
-log4j.rootLogger=INFO, R
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-log4j.appender.R.File=${AMBARI_LOG_DIR}/ambari-controller.log
-log4j.appender.R.MaxFileSize=10MB
-log4j.appender.R.MaxBackupIndex=10
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-log4j.appender.R.layout.ConversionPattern=%d{ISO8601} %p %t %c{1} - %m%n
+# log4j configuration used during build and unit tests
+log4j.rootLogger=INFO,stdout
+log4j.threshhold=ALL
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.follow=true
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p %t %c{1} - %m%n
+log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p [%t] %c{2} (%F:%M(%L)) - %m%n
+log4j.logger.org.apache.ambari=DEBUG
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/assemblies/server.xml
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/assemblies/server.xml?rev=1393285&r1=1393284&r2=1393285&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/assemblies/server.xml (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/assemblies/server.xml Wed Oct 3 04:22:19 2012
@@ -48,17 +48,19 @@
<fileMode>0755</fileMode>
</fileSet>
-->
-
<fileSet>
<directory>${basedir}/src/main/resources/</directory>
<outputDirectory>/ambari-server-${project.version}/keystore</outputDirectory>
<includes>
<include>db/*</include>
<include>ca.config</include>
- <include>pass.txt</include>
+ <include>pass.txt</include>
</includes>
</fileSet>
-
+ <fileSet>
+ <directory>src/main/conf</directory>
+ <outputDirectory>/ambari-server-${project.version}/conf</outputDirectory>
+ </fileSet>
<fileSet>
<directory>src/main/assemblies</directory>
<outputDirectory>/ambari-server-${project.version}/res</outputDirectory>
@@ -66,7 +68,6 @@
<exclude>*</exclude>
</excludes>
</fileSet>
-
</fileSets>
<dependencySets>
<dependencySet>
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java?rev=1393285&r1=1393284&r2=1393285&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java Wed Oct 3 04:22:19 2012
@@ -28,14 +28,15 @@ import org.apache.ambari.server.configur
import org.apache.ambari.server.orm.GuiceJpaInitializer;
import org.apache.ambari.server.security.CertificateManager;
import org.apache.ambari.server.security.SecurityFilter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.security.SslSocketConnector;
import org.mortbay.jetty.servlet.Context;
import org.mortbay.jetty.servlet.DefaultServlet;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.webapp.WebAppContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.spi.LoggerFactoryBinder;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.web.context.WebApplicationContext;
@@ -51,7 +52,7 @@ import com.sun.jersey.spi.container.serv
@Singleton
public class AmbariServer {
public static final String PERSISTENCE_PROVIDER = "ambari-postgres";
- private static Log LOG = LogFactory.getLog(AmbariServer.class);
+ private static Logger LOG = LoggerFactory.getLogger(AmbariServer.class);
public static int CLIENT_ONE_WAY = 4080;
public static int CLIENT_TWO_WAY = 8443;
public static int CLIENT_API_PORT = 8080;
@@ -194,7 +195,6 @@ public class AmbariServer {
"org.apache.ambari.server.resources.api.rest");
root.addServlet(resources, "/resources/*");
resources.setInitOrder(6);
-
server.setStopAtShutdown(true);
serverForAgent.setStopAtShutdown(true);
springAppContext.start();
@@ -204,7 +204,8 @@ public class AmbariServer {
server.start();
serverForAgent.start();
- LOG.info("Started Server");
+ LOG.info("********* Started Server **********");
+
server.join();
LOG.info("Joined the Server");
} catch (Exception e) {