code: private static void _logCommError(Exception e, HttpURLConnection conn, String url,
                                        String appKey, String method, Map<String, String> params) {
          DateFormat df = new SimpleDateFormat(AlipayConstants.DATE_TIME_FORMAT);
          df.setTimeZone(TimeZone.getTimeZone(AlipayConstants.DATE_TIMEZONE));
          String sdkName = AlipayConstants.SDK_VERSION;
          String urlStr = null;
          String rspCode = "";
          if (conn != null) {
              try {
                  urlStr = conn.getURL().toString();
                  rspCode = "HTTP_ERROR_" + conn.getResponseCode();
              } catch (IOException ioe) {
              }
          } else {
              urlStr = url;
              rspCode = "";
          }
          StringBuilder sb = new StringBuilder();
          sb.append(df.format(new Date()));// 时间
          sb.append("^_^");
          sb.append(method);// API
          sb.append("^_^");
          sb.append(appKey);// APP
          sb.append("^_^");
          sb.append(getIp());// IP地址
          sb.append("^_^");
          sb.append(osName);// 操作系统
          sb.append("^_^");
          sb.append(sdkName);// SDK名字,这是例子，请换成其他名字
          sb.append("^_^");
          sb.append(urlStr);// 请求URL
          sb.append("^_^");
          sb.append(rspCode);
          sb.append("^_^");
          sb.append((e.getMessage() + "").replaceAll("\r\n", " "));
          clog.error(sb.toString());
      }
docs: 通讯错误日志