private File generateLogsTableScript() throws HiveMetaException {
    try {
      File tmpFile = File.createTempFile("schematool", ".sql");
      tmpFile.deleteOnExit();
      FileWriter fstream = new FileWriter(tmpFile.getPath());
      try (BufferedWriter out = new BufferedWriter(fstream)) {
        out.write("USE SYS;" + System.getProperty("line.separator"));

        out.write("CREATE EXTERNAL TABLE logs");
        out.write(" (facility STRING, severity STRING,");
        out.write(" version STRING, ts TIMESTAMP, hostname STRING, app_name STRING,");
        out.write(" proc_id STRING, msg_id STRING, structured_data map<STRING,STRING>, msg BINARY,");
        out.write(" unmatched BINARY)");
        out.write(" PARTITIONED BY (dt DATE, ns STRING, app STRING)");
        out.write(" STORED BY 'org.apache.hadoop.hive.ql.log.syslog.SyslogStorageHandler'");
        out.write(" LOCATION '" + logPath + "'");
        out.write(" TBLPROPERTIES (\"partition.retention.period\"=\"" + retentionPeriod + "\");");
        out.write(System.getProperty("line.separator"));
      }

      return tmpFile;
    } catch (Exception err) {
      throw new HiveMetaException("Error generating logs table script", err);
    }
  }
Path of the warehouse/compute logs directory.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskCreateLogsTable.java