private void mergeLogs(List<LogDefinition> parentLogs, List<LogDefinition> childLogs) {
    Collection<String> existingLogIds = new HashSet<>();

    for (LogDefinition childLog : childLogs) {
      existingLogIds.add(childLog.getLogId());
    }
    if (parentLogs != null) {
      for (LogDefinition parentLog : parentLogs) {
        if (! existingLogIds.contains(parentLog.getLogId())) {
          childLogs.add(parentLog);
        }
      }
    }
  }
Merge logs.
Child logs override a parent log of the same log id.

@param parentLogs  parent logs
@param childLogs   child logs
ambari-server/src/main/java/org/apache/ambari/server/stack/ComponentModule.java