Skip to content

Commit 152274e

Browse files
committed
Log the data that's sent to the sms provider
1 parent d162be8 commit 152274e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

myconext-server/src/main/java/myconext/sms/SMSServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package myconext.sms;
22

33
import lombok.SneakyThrows;
4+
import myconext.tiqr.TiqrController;
45
import org.apache.commons.io.IOUtils;
6+
import org.apache.commons.logging.Log;
7+
import org.apache.commons.logging.LogFactory;
58
import org.springframework.core.io.ClassPathResource;
69
import org.springframework.http.HttpHeaders;
710
import org.springframework.http.HttpMethod;
@@ -25,6 +28,8 @@ public class SMSServiceImpl implements SMSService {
2528
private final String templateEn;
2629
private final RestTemplate restTemplate = new RestTemplate();
2730
private final MultiValueMap<String, String> headers = new HttpHeaders();
31+
private static final Log LOG = LogFactory.getLog(SMSServiceImpl.class);
32+
2833

2934
@SneakyThrows
3035
public SMSServiceImpl(String url, String bearer, String route) {
@@ -54,6 +59,7 @@ public String send(String mobile, String code, Locale locale) {
5459
);
5560

5661
RequestEntity<?> requestEntity = new RequestEntity(body, headers, HttpMethod.POST, URI.create(url));
62+
LOG.info(String.format("SMS url : %s, route : %s body: %s", url, route, requestEntity.getBody()));
5763
restTemplate.exchange(requestEntity, Void.class);
5864
return format;
5965
}

0 commit comments

Comments
 (0)