public static void dumpTailOfLogs(PrintWriter out, long tailKb) throws IOException {
    Set<File> logs = Log4jUtils.getActiveLogFiles();
    for (File f : logs) {
      out.println("+++++++++++++++++++++++++++++++");
      out.println(f.getAbsolutePath());
      out.println("+++++++++++++++++++++++++++++++");
      try {
        dumpTailOfLog(f, out, tailKb);
      } catch (IOException ioe) {
        out.println("Unable to dump log at " + f);
        ioe.printStackTrace(out);
      }
      out.println("\n\n");
    }
  }
Utility functions for reading the log4j logs that are being written by HBase.
hbase-http/src/main/java/org/apache/hadoop/hbase/util/LogMonitoring.java