1.增加上报开关,从配置文件里配置

2.port、rule上报任务
This commit is contained in:
chenjinsong
2018-10-09 18:11:38 +08:00
parent e0b516d3dd
commit 3a8a20de7b
6 changed files with 119 additions and 23 deletions

View File

@@ -66,7 +66,8 @@ public class HttpClientUtil {
*/
public String post(String url, String json) throws ClientProtocolException, IOException{
//实例化httpClient
logger.info("发送post请求" + url + ":::" + json);
logger.info("发送post请求" + url);
logger.debug("发送post请求" + url + ":::" + json);
CloseableHttpClient httpclient = HttpClients.createDefault();
//实例化post方法
HttpPost httpPost = new HttpPost(url);
@@ -80,7 +81,8 @@ public class HttpClientUtil {
//执行post方法
response = httpclient.execute(httpPost);
content = EntityUtils.toString(response.getEntity(), "utf-8");
logger.info("post请求结束" + response.getStatusLine().getStatusCode() + ":::" + content);
logger.info("post请求结束" + response.getStatusLine().getStatusCode());
logger.debug("post请求结束" + response.getStatusLine().getStatusCode() + ":::" + content);
return content;
}
}