api 수신로그 info로 변경
This commit is contained in:
@@ -42,24 +42,24 @@ public class ApiController {
|
|||||||
@RequestMapping(value = "/{_:^(?!plugins|dist|favicon.ico).*$}/**")
|
@RequestMapping(value = "/{_:^(?!plugins|dist|favicon.ico).*$}/**")
|
||||||
public ResponseEntity<String> mockApi(HttpEntity<String> httpEntity, HttpServletRequest request,
|
public ResponseEntity<String> mockApi(HttpEntity<String> httpEntity, HttpServletRequest request,
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
logger.debug("==================================================");
|
logger.info("==================================================");
|
||||||
logger.debug("==================================================");
|
logger.info("==================================================");
|
||||||
logger.debug(request.getServletPath());
|
logger.info(request.getServletPath());
|
||||||
logger.debug("--------------------------------------------------");
|
logger.info("--------------------------------------------------");
|
||||||
logger.debug("httpEntity.getHeaders().toString()= {}", httpEntity.getHeaders());
|
logger.info("httpEntity.getHeaders().toString()= {}", httpEntity.getHeaders());
|
||||||
logger.debug("--------------------------------------------------");
|
logger.info("--------------------------------------------------");
|
||||||
logger.debug("httpEntity.getBody()={}", httpEntity.getBody());
|
logger.info("httpEntity.getBody()={}", httpEntity.getBody());
|
||||||
logger.debug("--------------------------------------------------");
|
logger.info("--------------------------------------------------");
|
||||||
|
|
||||||
Map<String, String[]> paramMap = request.getParameterMap();
|
Map<String, String[]> paramMap = request.getParameterMap();
|
||||||
for (Entry<String, String[]> entry : paramMap.entrySet()) {
|
for (Entry<String, String[]> entry : paramMap.entrySet()) {
|
||||||
for (String value : entry.getValue()) {
|
for (String value : entry.getValue()) {
|
||||||
logger.debug("{}={}", entry.getKey(), value);
|
logger.info("{}={}", entry.getKey(), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("==================================================");
|
logger.info("==================================================");
|
||||||
logger.debug("==================================================");
|
logger.info("==================================================");
|
||||||
|
|
||||||
String url = request.getServletPath();
|
String url = request.getServletPath();
|
||||||
String serviceValue = assignServiceValue(httpEntity, request, url);
|
String serviceValue = assignServiceValue(httpEntity, request, url);
|
||||||
@@ -81,13 +81,13 @@ public class ApiController {
|
|||||||
int sleepSeconds = api.getSleepSeconds().intValue();
|
int sleepSeconds = api.getSleepSeconds().intValue();
|
||||||
if (sleepSeconds > 0) {
|
if (sleepSeconds > 0) {
|
||||||
try {
|
try {
|
||||||
logger.debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
logger.info("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
||||||
logger.debug("Start Sleep {} Seconds.", sleepSeconds);
|
logger.info("Start Sleep {} Seconds.", sleepSeconds);
|
||||||
logger.debug("...");
|
logger.info("...");
|
||||||
Thread.sleep(sleepSeconds * 1000l);
|
Thread.sleep(sleepSeconds * 1000l);
|
||||||
logger.debug("......");
|
logger.info("......");
|
||||||
logger.debug("Finished Sleep {} Seconds.", sleepSeconds);
|
logger.info("Finished Sleep {} Seconds.", sleepSeconds);
|
||||||
logger.debug("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
logger.info("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
logger.error("sleep", e);
|
logger.error("sleep", e);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ public class ApiController {
|
|||||||
int responseStatusCode = 200;
|
int responseStatusCode = 200;
|
||||||
if (api.getResponseStatusCode() != null) {
|
if (api.getResponseStatusCode() != null) {
|
||||||
responseStatusCode = api.getResponseStatusCode().intValue();
|
responseStatusCode = api.getResponseStatusCode().intValue();
|
||||||
logger.debug("Response Status Code={}", responseStatusCode);
|
logger.info("Response Status Code={}", responseStatusCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ResponseEntity<String>(assignResponseBody(api), responseHeaders, responseStatusCode);
|
return new ResponseEntity<String>(assignResponseBody(api), responseHeaders, responseStatusCode);
|
||||||
@@ -155,10 +155,10 @@ public class ApiController {
|
|||||||
int startIdx = NumberUtils.toInt(args[0]);
|
int startIdx = NumberUtils.toInt(args[0]);
|
||||||
int length = NumberUtils.toInt(args[1]);
|
int length = NumberUtils.toInt(args[1]);
|
||||||
String serviceValue = msg.substring(startIdx, startIdx + length);
|
String serviceValue = msg.substring(startIdx, startIdx + length);
|
||||||
logger.debug("--------------------------------------------------");
|
logger.info("--------------------------------------------------");
|
||||||
logger.debug("serviceCode={}", serviceValue);
|
logger.info("serviceCode={}", serviceValue);
|
||||||
logger.debug("==================================================");
|
logger.info("==================================================");
|
||||||
logger.debug("==================================================");
|
logger.info("==================================================");
|
||||||
if (StringUtils.isBlank(serviceValue)) {
|
if (StringUtils.isBlank(serviceValue)) {
|
||||||
throw new ResponseStatusException(HttpStatus.NOT_FOUND,
|
throw new ResponseStatusException(HttpStatus.NOT_FOUND,
|
||||||
String.format("sbi-std-servlet not found(URL=%s, ServiceKey=%s)", url, serviceKey));
|
String.format("sbi-std-servlet not found(URL=%s, ServiceKey=%s)", url, serviceKey));
|
||||||
|
|||||||
Reference in New Issue
Block a user