public static String getLogFilePath() {
    String logFilePath = null;
    org.apache.logging.log4j.Logger rootLogger = LogManager.getRootLogger();
    if (rootLogger instanceof org.apache.logging.log4j.core.Logger coreLogger) {
      for (Appender appender : coreLogger.getAppenders().values()) {
        if (appender instanceof FileAppender fileAppender) {
          logFilePath = fileAppender.getFileName();
        } else if (appender instanceof RollingFileAppender fileAppender) {
          logFilePath = fileAppender.getFileName();
        } else if (appender instanceof RollingRandomAccessFileAppender fileAppender) {
          logFilePath = fileAppender.getFileName();
        }
      }
    }
    return logFilePath;
  }
Get path of the log file for user to see on the WebUI.
common/src/java/org/apache/hadoop/hive/common/LogUtils.java