From 74d8298a250f51a1846a92dadf15126ec9ce46f2 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 20 Feb 2024 11:43:00 +0100 Subject: [PATCH] refactor: Set logging-level for io.projectreactor to `DEBUG` --- .../backend/api/ChatBackendController.java | 6 +++++- .../storage/files/FilesStorageStrategy.java | 21 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java index 070abf2e..1a8711a0 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java +++ b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java @@ -10,6 +10,7 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import java.util.UUID; +import java.util.logging.Level; @RestController @@ -118,7 +119,10 @@ public class ChatBackendController { return chatRoomData .listen() - .log() + .log( + ChatBackendController.class.getSimpleName(), + Level.FINE, + true) .map(message -> MessageTo.from(message)) .map(messageTo -> ServerSentEvent diff --git a/src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java index cdb4f0d7..fd8939b6 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/storage/files/FilesStorageStrategy.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.UUID; +import java.util.logging.Level; import static java.nio.file.StandardOpenOption.CREATE; import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; @@ -49,7 +50,10 @@ public class FilesStorageStrategy implements StorageStrategy .createGenerator(Files.newBufferedWriter(path, CREATE, TRUNCATE_EXISTING)); return chatRoomInfoFlux - .log() + .log( + FilesStorageStrategy.class.getSimpleName(), + Level.FINE, + true) .doFirst(() -> { try @@ -100,7 +104,10 @@ public class FilesStorageStrategy implements StorageStrategy JavaType type = mapper.getTypeFactory().constructType(ChatRoomInfoTo.class); return Flux .from(new JsonFilePublisher(chatroomsPath(), mapper, type)) - .log() + .log( + FilesStorageStrategy.class.getSimpleName(), + Level.FINE, + true) .map(chatRoomInfoTo -> { UUID chatRoomId = chatRoomInfoTo.getId(); @@ -136,7 +143,10 @@ public class FilesStorageStrategy implements StorageStrategy .createGenerator(Files.newBufferedWriter(path, CREATE, TRUNCATE_EXISTING)); return messageFlux - .log() + .log( + FilesStorageStrategy.class.getSimpleName(), + Level.FINE, + true) .doFirst(() -> { try @@ -187,7 +197,10 @@ public class FilesStorageStrategy implements StorageStrategy JavaType type = mapper.getTypeFactory().constructType(MessageTo.class); return Flux .from(new JsonFilePublisher(chatroomPath(chatRoomId), mapper, type)) - .log() + .log( + FilesStorageStrategy.class.getSimpleName(), + Level.FINE, + true) .map(MessageTo::toMessage); } -- 2.20.1