From 4103c49bb6debab46d07b081e6f37fda88d5cae7 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 19 Jun 2019 10:52:07 +0300 Subject: Clean up logging --- src/main/java/com/juick/server/ActivityPubManager.java | 1 - src/main/java/com/juick/server/SignatureManager.java | 5 ++--- src/main/java/com/juick/server/api/activity/model/Context.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/juick/server/ActivityPubManager.java b/src/main/java/com/juick/server/ActivityPubManager.java index 94a8434e..400a63d4 100644 --- a/src/main/java/com/juick/server/ActivityPubManager.java +++ b/src/main/java/com/juick/server/ActivityPubManager.java @@ -193,7 +193,6 @@ public class ActivityPubManager implements ActivityListener, NotificationListene create.setPublished(note.getPublished()); create.setObject(note); try { - logger.info("Posting to subscriber {}", follower.getId()); signatureManager.post(me, follower, create); } catch (IOException e) { logger.warn("activitypub exception", e); diff --git a/src/main/java/com/juick/server/SignatureManager.java b/src/main/java/com/juick/server/SignatureManager.java index b64b6bd7..fc458533 100644 --- a/src/main/java/com/juick/server/SignatureManager.java +++ b/src/main/java/com/juick/server/SignatureManager.java @@ -38,7 +38,7 @@ import static com.juick.server.api.activity.model.Context.ACTIVITY_MEDIA_TYPE; @Component public class SignatureManager { - private static final Logger logger = LoggerFactory.getLogger(ActivityPubManager.class); + private static final Logger logger = LoggerFactory.getLogger(SignatureManager.class); @Inject private KeystoreManager keystoreManager; @Inject @@ -63,9 +63,8 @@ public class SignatureManager { requestHeaders.add("Signature", signatureString); HttpEntity request = new HttpEntity<>(Context.build(data), requestHeaders); logger.info("Sending context to {}: {}", to.getId(), jsonMapper.writeValueAsString(data)); - logger.info("Request date: {}", requestDate); ResponseEntity response = apClient.postForEntity(inbox, request, Void.class); - logger.info("accepted follower: {}", response.getStatusCodeValue()); + logger.info("Remote response: {}", response.getStatusCodeValue()); } public String addSignature(Person from, String host, String method, String path, String dateString) throws IOException { diff --git a/src/main/java/com/juick/server/api/activity/model/Context.java b/src/main/java/com/juick/server/api/activity/model/Context.java index 87e04a89..687848cc 100644 --- a/src/main/java/com/juick/server/api/activity/model/Context.java +++ b/src/main/java/com/juick/server/api/activity/model/Context.java @@ -94,7 +94,7 @@ public abstract class Context { } public static Context build(Context response) { - response.context = new ArrayList(Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI)); + response.context = new ArrayList<>(Arrays.asList(ACTIVITY_STREAMS_URI, SECURITY_URI)); response.context.add(Collections.singletonMap("Hashtag", "as:Hashtag")); return response; } -- cgit v1.2.3