Optimized some logs

This commit is contained in:
Francesco Mangiacrapa 2023-12-20 17:35:37 +01:00
parent 0b4a357037
commit abc4724701
4 changed files with 31 additions and 4 deletions

View File

@ -953,7 +953,20 @@ public class Geoportal_JSON_Mapper {
} catch (Exception e) {
LOG.error("AccessPolicy not found. Check OK");
}
LOG.info("It is {} accessible the section {}", isAccessible, sectionDocumentJSON);
//Just to print
int toEndString = 0;
try {
toEndString = sectionDocumentJSON.length()/3;
}catch (Exception e) {
//Silent
toEndString = 0;
}
if(LOG.isDebugEnabled()) {
LOG.debug("It is {} accessible the section {}", isAccessible, sectionDocumentJSON);
}
LOG.info("It is {} accessible the section {}", isAccessible, sectionDocumentJSON.substring(0,toEndString)+"...");
return isAccessible;
}

View File

@ -2,11 +2,9 @@ package org.gcube.application.geoportaldatamapper.exporter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.nio.file.StandardCopyOption;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;

View File

@ -80,7 +80,9 @@ public class MapBoxEndpointReader {
ap.setApiTokenPwd(apiTokenPwd);
listSAP.add(ap);
}
LOG.info("SE in the scope: " + ScopeProvider.instance.get() + " with profile name: " + SE_PROFILE_NAME
+ " and category name: " + SE_CATEGORY_NAME + "is returning: "+listSAP);
return listSAP;
}

View File

@ -9,4 +9,18 @@ public class ServiceAccessPoint {
String url;
String apiTokenName;
String apiTokenPwd;
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("ServiceAccessPoint [url=");
builder.append(url);
builder.append(", apiTokenName=");
builder.append(apiTokenName);
builder.append(", apiTokenPwd=");
builder.append("MASKED_PWD");
builder.append("]");
return builder.toString();
}
}