Skip to content

Commit

Permalink
add eTranslation request body to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
gsergiu committed May 27, 2024
1 parent d96111f commit 04b4c71
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ private String getTranslatioCallbackUrl() {
return this.translationApiBaseUrl + eTranslationCallbackRelativeUrl;
}

private void validateETranslConfigParams(String baseUrl, String domain, String translationApiBaseUrl,
private void validateETranslConfigParams(String etranslationServiceBaseUrl, String domain, String translationApiBaseUrl,
int maxWaitMillisec, String username, String password) throws TranslationException {
List<String> missingParams= new ArrayList<>(6);
if(StringUtils.isBlank(baseUrl)) {
if(StringUtils.isBlank(etranslationServiceBaseUrl)) {
missingParams.add("baseUrl");
}
if(StringUtils.isBlank(domain)) {
Expand Down Expand Up @@ -309,9 +309,9 @@ private long createHttpRequest(String content) throws TranslationException, IOEx
credsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(credentialUsername, credentialPwd));
CloseableHttpClient httpClient = HttpClientBuilder.create().setDefaultCredentialsProvider(credsProvider).build();
HttpPost request = new HttpPost(baseUrl);
StringEntity params = new StringEntity(content, "UTF-8");
StringEntity body = new StringEntity(content, "UTF-8");
request.addHeader("content-type", "application/json");
request.setEntity(params);
request.setEntity(body);

CloseableHttpResponse response = httpClient.execute(request);
StatusLine respStatusLine = response.getStatusLine();
Expand All @@ -326,7 +326,7 @@ private long createHttpRequest(String content) throws TranslationException, IOEx
try{
requestNumber = Long.parseLong(respBody);
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("eTranslation request sent with the request-id: {} .", requestNumber);
LOGGER.debug("eTranslation request sent with the request-id: {} and body: {}.", requestNumber, body);
}
if(requestNumber < 0) {
throw wrapETranslationErrorResponse(respBody);
Expand Down

0 comments on commit 04b4c71

Please sign in to comment.