String getLogDir(Configuration conf) {
    String logDir = conf.get("hive.log.dir");
    if (logDir == null) {
      logDir = System.getProperty("hive.log.dir");
    }
    if (logDir != null) {
      return logDir;
    }

    LoggerContext context = (LoggerContext)LogManager.getContext(false);
    for (Logger logger: context.getLoggers()) {
      for (Appender appender: logger.getAppenders().values()) {
        if (appender instanceof AbstractOutputStreamAppender outputAppender) {
          OutputStreamManager manager =
            outputAppender.getManager();
          if (manager instanceof FileManager fileManager) {
            String fileName = fileManager.getFileName();
            if (fileName != null) {
              return fileName.substring(0, fileName.lastIndexOf('/'));
            }
          }
        }
      }
    }
    return null;
  }
Set servlet context attributes that can be used in jsp.
common/src/java/org/apache/hive/http/HttpServer.java