Commit d2b6eb78 authored by Ankur Rawat's avatar Ankur Rawat
Browse files

changed logger

parent 68a9fe6b
Pipeline #121247 failed with stages
in 115 minutes and 54 seconds
......@@ -30,6 +30,8 @@ import org.opengroup.osdu.core.common.model.legal.LegalTagProperties;
import org.opengroup.osdu.core.common.model.storage.Record;
import org.opengroup.osdu.core.common.model.storage.RecordIdWithVersion;
import org.opengroup.osdu.core.common.model.storage.RecordMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
......@@ -54,6 +56,8 @@ public class LegalServiceImpl implements ILegalService {
@Autowired
private JaxRsDpsLog log;
private final static Logger LOGGER = LoggerFactory.getLogger(LegalServiceImpl.class);
@Override
public void validateLegalTags(Set<String> legaltags) {
......@@ -64,7 +68,7 @@ public class LegalServiceImpl implements ILegalService {
InvalidTagWithReason[] invalidLegalTags = this.getInvalidLegalTags(legaltags);
if (invalidLegalTags.length > 0) {
this.log.info("Invalid Legal Tags : {}", invalidLegalTags.toString());
LOGGER.info("Invalid Legal Tags : {}", invalidLegalTags.toString());
throw new AppException(HttpStatus.SC_BAD_REQUEST, "Invalid legal tags",
String.format("Invalid legal tags: %s", invalidLegalTags[0].getName()));
}
......@@ -152,14 +156,14 @@ public class LegalServiceImpl implements ILegalService {
currentLegalTagName = legalTagName;
legalTag = this.cache.get(legalTagName);
if (legalTag == null) {
this.log.info("Legal Tag not present in the cache.");
LOGGER.info("Legal Tag not present in the cache.");
return false;
}
}
} catch (RedisException ex) {
this.log.error(String.format("Error getting key %s from redis: %s", currentLegalTagName, ex.getMessage()), ex);
}
this.log.info("Legal Tags are present in cache {}", legalTagNames.toString());
LOGGER.info("Legal Tags are present in cache {}", legalTagNames.toString());
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment