aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2023-01-19 18:07:59 +0300
committerGravatar Vitaly Takmazov2023-01-19 18:07:59 +0300
commite379e33fef1fcdd6e210b079c504253120647ea5 (patch)
tree66485b6313d739bfa5767d902fdf5635e3961c4b
parent12e2206f9d24b29c8276b2743603635620643444 (diff)
Improve logging
-rw-r--r--src/main/java/com/juick/config/ActivityPubClientErrorHandler.java2
-rw-r--r--src/main/java/com/juick/service/ActivityPubService.java2
-rw-r--r--src/main/java/com/juick/service/WebfingerService.java8
3 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java b/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
index 65b67110..c6e59768 100644
--- a/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
+++ b/src/main/java/com/juick/config/ActivityPubClientErrorHandler.java
@@ -44,7 +44,7 @@ public class ActivityPubClientErrorHandler implements Interceptor {
var url = request.url();
if (!response.isSuccessful()) {
if (response.code() == HttpStatus.GONE.value()) {
- logger.warn("Server report {} is gone, deleting", url);
+ logger.debug("Server report {} is gone, deleting", url);
applicationEventPublisher.publishEvent(new DeleteUserEvent(this, url.toString()));
} else {
logger.warn("HTTP ERROR {} on {} : {}", response.code(),
diff --git a/src/main/java/com/juick/service/ActivityPubService.java b/src/main/java/com/juick/service/ActivityPubService.java
index 7eff123f..4e3187a9 100644
--- a/src/main/java/com/juick/service/ActivityPubService.java
+++ b/src/main/java/com/juick/service/ActivityPubService.java
@@ -151,7 +151,7 @@ public class ActivityPubService extends BaseJdbcService implements SocialService
}
}
} catch (IOException e) {
- logger.warn("HTTP Signature exception: {}", e.getMessage());
+ logger.warn("HTTP Signature exception reading {}: {}", contextUri.toASCIIString(), e.getMessage());
}
return Optional.empty();
}
diff --git a/src/main/java/com/juick/service/WebfingerService.java b/src/main/java/com/juick/service/WebfingerService.java
index ca49bd51..4accfc94 100644
--- a/src/main/java/com/juick/service/WebfingerService.java
+++ b/src/main/java/com/juick/service/WebfingerService.java
@@ -24,22 +24,18 @@ import com.juick.www.api.webfinger.model.Link;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.http.*;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
-import org.springframework.web.client.RestClientException;
import org.springframework.web.util.UriComponentsBuilder;
import rocks.xmpp.addr.Jid;
import javax.inject.Inject;
import java.io.IOException;
import java.net.URI;
-import java.util.Collections;
@Component
public class WebfingerService {
- private static final Logger logger = LoggerFactory.getLogger("ActivityPub");
private final OkHttpClient httpClient;
private final ObjectMapper jsonMapper;
@Inject