import reactor.core.publisher.Mono;
import java.util.UUID;
+import java.util.logging.Level;
@RestController
{
return chatRoomData
.listen()
- .log()
+ .log(
+ ChatBackendController.class.getSimpleName(),
+ Level.FINE,
+ true)
.map(message -> MessageTo.from(message))
.map(messageTo ->
ServerSentEvent
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;
.createGenerator(Files.newBufferedWriter(path, CREATE, TRUNCATE_EXISTING));
return chatRoomInfoFlux
- .log()
+ .log(
+ FilesStorageStrategy.class.getSimpleName(),
+ Level.FINE,
+ true)
.doFirst(() ->
{
try
JavaType type = mapper.getTypeFactory().constructType(ChatRoomInfoTo.class);
return Flux
.from(new JsonFilePublisher<ChatRoomInfoTo>(chatroomsPath(), mapper, type))
- .log()
+ .log(
+ FilesStorageStrategy.class.getSimpleName(),
+ Level.FINE,
+ true)
.map(chatRoomInfoTo ->
{
UUID chatRoomId = chatRoomInfoTo.getId();
.createGenerator(Files.newBufferedWriter(path, CREATE, TRUNCATE_EXISTING));
return messageFlux
- .log()
+ .log(
+ FilesStorageStrategy.class.getSimpleName(),
+ Level.FINE,
+ true)
.doFirst(() ->
{
try
JavaType type = mapper.getTypeFactory().constructType(MessageTo.class);
return Flux
.from(new JsonFilePublisher<MessageTo>(chatroomPath(chatRoomId), mapper, type))
- .log()
+ .log(
+ FilesStorageStrategy.class.getSimpleName(),
+ Level.FINE,
+ true)
.map(MessageTo::toMessage);
}