private void configureViewLogging(ViewEntity viewDefinition, ClassLoader cl) {
    InputStream viewLog4jStream = cl.getResourceAsStream(VIEW_LOG_FILE);
    InputStream ambariLog4jStream = null;
    if (null != viewLog4jStream) {
      try {
        Properties viewLog4jConfig = new Properties();
        viewLog4jConfig.load(viewLog4jStream);
        LOG.info("setting up logging for view {} as per property file {}", viewDefinition.getName(), VIEW_LOG_FILE);

        ambariLog4jStream = cl.getResourceAsStream(AMBARI_LOG_FILE);
        if (null != ambariLog4jStream) {
          Properties ambariLog4jConfig = new Properties();
          ambariLog4jConfig.load(ambariLog4jStream);

          // iterate through all the ambari configs and get the once not starting from log4j
          // set them into view properties and remove any log4j property which view might be overriding.
          for (Object property : ambariLog4jConfig.keySet()) {
            String prop = (String) property;
            if (prop.startsWith(LOG4J)) {
              viewLog4jConfig.remove(prop);
            } else {
              viewLog4jConfig.put(prop, ambariLog4jConfig.getProperty(prop));
            }
          }
        }

        PropertyConfigurator.configure(viewLog4jConfig);
      } catch (IOException e) {
        LOG.error("Error occurred while configuring logs for {}", viewDefinition.getName());
      } finally {
        Closeables.closeSilently(ambariLog4jStream);
        Closeables.closeSilently(viewLog4jStream);
      }
    }
  }
copies non-log4j properties (like ambari.log.dir) from ambari's log4j.properties into view's log4j properties
and removes log4j specific properties (log4j.rootLogger) inside ambari's log4j.properties from view's log4j properties
It then configures the log4j with view's properties.

@param viewDefinition
@param cl
ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java