diff --git a/src/main/java/net/frozenorb/apiv3/model/IpIntel.java b/src/main/java/net/frozenorb/apiv3/model/IpIntel.java index cf20c51..44e90f4 100644 --- a/src/main/java/net/frozenorb/apiv3/model/IpIntel.java +++ b/src/main/java/net/frozenorb/apiv3/model/IpIntel.java @@ -16,7 +16,6 @@ import java.time.Instant; import java.util.LinkedList; import java.util.List; -@Slf4j @Entity @AllArgsConstructor public final class IpIntel { @@ -36,31 +35,22 @@ public final class IpIntel { } public static void findOrCreateById(String id, SingleResultCallback callback) { - log.info("ip intel for " + id + " queried..."); - findById(id, (existingIpIntel, error) -> { if (error != null) { - log.info("ip intel for " + id + " db check failed"); callback.onResult(null, error); } else if (existingIpIntel != null) { - log.info("ip intel for " + id + " found in db, returning that"); callback.onResult(existingIpIntel, null); } else { - log.info("ip intel for " + id + " not found, calling maxmind"); MaxMindUtils.getInsights(id, (maxMindResult, error2) -> { if (error2 != null) { - log.info("ip intel for " + id + " maxmind query failed"); callback.onResult(null, error2); } else { - log.info("ip intel for " + id + " returned from maxmind, inserting"); IpIntel newIpIntel = new IpIntel(id, maxMindResult); ipIntelCollection.insertOne(newIpIntel, (ignored, error3) -> { if (error3 != null) { - log.info("ip intel for " + id + " insertion failed"); callback.onResult(null, error3); } else { - log.info("ip intel for " + id + " insertion succeeded"); callback.onResult(newIpIntel, null); } }); diff --git a/src/main/java/net/frozenorb/apiv3/util/MaxMindUtils.java b/src/main/java/net/frozenorb/apiv3/util/MaxMindUtils.java index 5468248..2b6fe33 100644 --- a/src/main/java/net/frozenorb/apiv3/util/MaxMindUtils.java +++ b/src/main/java/net/frozenorb/apiv3/util/MaxMindUtils.java @@ -23,8 +23,6 @@ public class MaxMindUtils { public static void getInsights(String ip, SingleResultCallback callback) { String authHeader = "Basic " + Base64.getEncoder().encodeToString((maxMindUserId + ":" + maxMindLicenseKey).getBytes(Charsets.UTF_8)); - log.info("Requesting ip info for " + ip + " from MaxMind."); - httpsClient.get(443, "geoip.maxmind.com", "/geoip/v2.1/insights/" + ip, (response) -> { response.bodyHandler((body) -> { JsonObject bodyJson = new JsonObject(body.toString());