public String getMRJobLog(String mrJobId) {
    String mrJobHistoryURL = "http://" + jhistoryAddr + "/ws/v1/history/mapreduce/jobs/" + mrJobId;
    try {
      JsonNode response = fetchJson(new URL(mrJobHistoryURL));
      if (!response.get("job").get("state").toString().equals("SUCCEEDED")) {
        return response.get("job").get("diagnostics").getTextValue();
      }
    } catch (MalformedURLException e) {
      logger.error(String.format("Malformed URL %s in MR Client: %s ", mrJobHistoryURL, e.getMessage()));
    } catch (NullPointerException e) {
      logger.error(String.format("Invalid response %s", e.getMessage()));
    } catch (IOException e) {
      logger.error(String.format("IOException in Mr Client: %s", e.getMessage()));
    }
    return null;
  }
Returns the diagnostics for a given MR Job Id
@param mrJobId  MR Job Id
@return Diagnostics in a string format
app/com/linkedin/drelephant/exceptions/MRClient.java