Skip to content
Snippets Groups Projects
Commit 2f7c99ae authored by Alan Braz's avatar Alan Braz
Browse files

fix logs

parent 296af4ef
No related branches found
No related tags found
1 merge request!6Trusted ibm
......@@ -23,15 +23,15 @@ import org.opengroup.osdu.core.ibm.cloudant.IBMCloudantClientFactory;
import org.opengroup.osdu.indexer.ibm.model.ElasticSettingSchema;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Repository;
import com.cloudant.client.api.Database;
@Repository
public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
//private static final Logger logger = LoggerFactory.getLogger(ElasticSettingSchemaRepositoryImpl.class);
@Inject
private JaxRsDpsLog log;
private JaxRsDpsLog logger;
@Value("${ibm.cloudant.url}")
private String url;
@Value("${ibm.cloudant.apikey}")
......@@ -71,7 +71,7 @@ public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
newSchema.setHttps(sd.getSettingSchema().isHttps());
return newSchema;
} else {
log.error(ElasticSettingsDoc.class + " with id " + id + " was not found in the database.");
logger.error(ElasticSettingsDoc.class + " with id " + id + " was not found in the database.");
return null;
}
}
......
......@@ -18,16 +18,16 @@ import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.ibm.logging.logger.OSDUSLF4JLogger;
import org.opengroup.osdu.core.common.model.http.Request;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
import org.opengroup.osdu.core.common.model.http.Request;
@Component
@RequestScope
@Primary
......@@ -36,10 +36,11 @@ public class DpsHeadersIBMQueue extends DpsHeaders {
@Value("${indexer.queue.key}")
private String queueKey;
//ToDo this should be moved to Azure client-lib
//TODO this should be moved to Azure client-lib
public static final String INDEXER_QUEUE_KEY = "x-functions-key";
@Inject
private OSDUSLF4JLogger logger;
private JaxRsDpsLog logger;
@Inject
private Request logRequest;
@Inject
......@@ -60,6 +61,7 @@ public class DpsHeadersIBMQueue extends DpsHeaders {
logRequest.setIp(request.getRemoteAddr());
logRequest.setRequestMethod(request.getMethod());
logRequest.setRequestUrl(request.getRequestURL().toString());
logger.writeRequestEntry("DpsHeadersIBMQueue", "DpsHeadersIBMQueue request", logRequest, headers);
logger.info(logRequest.toString());
logger.info(headers.toString());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment