mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
SPRINT-15: updates to logging
This commit is contained in:
@ -474,12 +474,12 @@ public class BaseAPIActionUtil
|
|||||||
int statusCode = response.getStatusCode();
|
int statusCode = response.getStatusCode();
|
||||||
String resultString = response.getContent();
|
String resultString = response.getContent();
|
||||||
String errorMessage = "HTTP " + request.getMethod() + " for table + [" + table.getName() + "] failed with status " + statusCode + ": " + resultString;
|
String errorMessage = "HTTP " + request.getMethod() + " for table + [" + table.getName() + "] failed with status " + statusCode + ": " + resultString;
|
||||||
|
LOG.warn(errorMessage);
|
||||||
|
|
||||||
if("GET".equals(request.getMethod()))
|
if("GET".equals(request.getMethod()))
|
||||||
{
|
{
|
||||||
if(statusCode == HttpStatus.SC_NOT_FOUND)
|
if(statusCode == HttpStatus.SC_NOT_FOUND)
|
||||||
{
|
{
|
||||||
LOG.warn(errorMessage);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -717,8 +717,7 @@ public class BaseAPIActionUtil
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
JSONObject jsonObject = JsonUtils.toJSONObject(response.getContent());
|
return JsonUtils.toJSONObject(response.getContent());
|
||||||
return jsonObject;
|
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
{
|
{
|
||||||
@ -749,10 +748,10 @@ public class BaseAPIActionUtil
|
|||||||
setupContentTypeInRequest(request);
|
setupContentTypeInRequest(request);
|
||||||
setupAdditionalHeaders(request);
|
setupAdditionalHeaders(request);
|
||||||
|
|
||||||
LOG.warn("Making [" + request.getMethod() + "] request to URL [" + request.getURI() + "] on table [" + table.getName() + "].");
|
LOG.info("Making [" + request.getMethod() + "] request to URL [" + request.getURI() + "] on table [" + table.getName() + "].");
|
||||||
if("POST".equals(request.getMethod()))
|
if("POST".equals(request.getMethod()))
|
||||||
{
|
{
|
||||||
LOG.warn("POST contents [" + ((HttpPost) request).getEntity().toString() + "]");
|
LOG.info("POST contents [" + ((HttpPost) request).getEntity().toString() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
try(CloseableHttpResponse response = httpClient.execute(request))
|
try(CloseableHttpResponse response = httpClient.execute(request))
|
||||||
@ -769,6 +768,7 @@ public class BaseAPIActionUtil
|
|||||||
handleResponseError(table, request, qResponse);
|
handleResponseError(table, request, qResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOG.info("Received successful response with code [" + qResponse.getStatusCode() + "] and content [" + qResponse.getContent() + "].");
|
||||||
return (qResponse);
|
return (qResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user