private static void setupChildLog4j(Configuration conf) {
    try {
      LogUtils.initHiveExecLog4j();
      LogDivertAppender.registerRoutingAppender(conf);
      LogDivertAppenderForTest.registerRoutingAppenderIfInTest(conf);
    } catch (LogInitializationException e) {
      System.err.println(e.getMessage());
    }
  }
we are running the hadoop job via a sub-command. this typically happens when we are running
jobs in local mode. the log4j in this mode is controlled as follows: 1. if the admin provides a
log4j properties file especially for execution mode - then we pick that up 2. otherwise - we
default to the regular hive log4j properties if one is supplied 3. if none of the above two
apply - we don't do anything - the log4j properties would likely be determined by hadoop.

The intention behind providing a separate option #1 is to be able to collect hive run time logs
generated in local mode in a separate (centralized) location if desired. This mimics the
behavior of hive run time logs when running against a hadoop cluster where they are available
on the tasktracker nodes.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ExecDriver.java