diff --git a/myconext-server/src/main/java/myconext/sms/SMSServiceImpl.java b/myconext-server/src/main/java/myconext/sms/SMSServiceImpl.java index 678ead54f..80a888983 100644 --- a/myconext-server/src/main/java/myconext/sms/SMSServiceImpl.java +++ b/myconext-server/src/main/java/myconext/sms/SMSServiceImpl.java @@ -1,7 +1,10 @@ package myconext.sms; import lombok.SneakyThrows; +import myconext.tiqr.TiqrController; import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; @@ -19,6 +22,8 @@ @SuppressWarnings("unchecked") public class SMSServiceImpl implements SMSService { + private static final Log LOG = LogFactory.getLog(SMSServiceImpl.class); + private final String url; public final String route; private final String templateNl; @@ -26,6 +31,7 @@ public class SMSServiceImpl implements SMSService { private final RestTemplate restTemplate = new RestTemplate(); private final MultiValueMap headers = new HttpHeaders(); + @SneakyThrows public SMSServiceImpl(String url, String bearer, String route) { this.url = url; @@ -53,7 +59,11 @@ public String send(String mobile, String code, Locale locale) { "recipients", List.of(mobile) ); - RequestEntity requestEntity = new RequestEntity(body, headers, HttpMethod.POST, URI.create(url)); + RequestEntity requestEntity = new RequestEntity<>(body, headers, HttpMethod.POST, URI.create(url)); + LOG.info(String.format("Sending SMS with url : %s, route : %s body: %s", + url, + route, + body)); restTemplate.exchange(requestEntity, Void.class); return format; }