serviceKey, response 로그 추가

This commit is contained in:
hsoh
2022-06-14 13:57:29 +09:00
parent 9eb0e9db72
commit 0eeae119a0
@@ -63,6 +63,12 @@ public class ApiController {
String url = request.getServletPath();
String serviceValue = assignServiceValue(httpEntity, request, url);
if (StringUtils.isNotBlank(serviceValue)) {
logger.info("--------------------------------------------------");
logger.info("serviceCode={}", serviceValue);
logger.info("==================================================");
logger.info("==================================================");
}
ApiInfo api = apiService.findByUrlAndServiceValue(url, serviceValue);
if (api == null) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND,
@@ -109,8 +115,11 @@ public class ApiController {
responseStatusCode = api.getResponseStatusCode().intValue();
logger.info("Response Status Code={}", responseStatusCode);
}
String responseStr = assignResponseBody(api);
logger.info("ResponseBody={}", responseStr);
return new ResponseEntity<String>(assignResponseBody(api), responseHeaders, responseStatusCode);
return new ResponseEntity<String>(responseStr, responseHeaders, responseStatusCode);
}
private String assignServiceValue(HttpEntity<String> httpEntity, HttpServletRequest request, String url) {
@@ -155,10 +164,6 @@ public class ApiController {
int startIdx = NumberUtils.toInt(args[0]);
int length = NumberUtils.toInt(args[1]);
String serviceValue = msg.substring(startIdx, startIdx + length);
logger.info("--------------------------------------------------");
logger.info("serviceCode={}", serviceValue);
logger.info("==================================================");
logger.info("==================================================");
if (StringUtils.isBlank(serviceValue)) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND,
String.format("sbi-std-servlet not found(URL=%s, ServiceKey=%s)", url, serviceKey));