i have a question related to logging on production for spring web-flux with project reactor. I have the following code on a staging env which log a lot of info related to signals which of course is very useful for debugging purposes.
Mono.zip(localChargeIdMono, userIdMono, merchantMono, totalAmountMono, requestIdMono)
.map(this::toNewTransaction)
.log("TransactionRepository.save")
.then(chargeMono)
.map(chargeResult -> Tuples.of(transaction, chargeResult))
.map(this::toNewTransactionUpdatedWithChargeResult))
.flatMap(tuple -> Mono.zip(
transactionRepository.save(tuple.getT1()),
paymentUpdateRepository.save(tuple.getT2())))
.log("t.p.save")
.map(Tuple2::getT1)
.map(this::toChargeTransactionDto);
But i was wondering whether this is the correct way of logging on production or should i use doOn* methods to log only relevant data such as side effects function in/out params.
Mono.zip(localChargeIdMono, userIdMono, merchantMono, totalAmountMono, requestIdMono)
.map(this::toNewTransaction)
.donOnNext(e -> log.info(e))
.then(chargeMono)
.map(chargeResult -> Tuples.of(transaction, chargeResult))
.map(this::toNewTransactionUpdatedWithChargeResult))
.flatMap(tuple -> Mono.zip(
transactionRepository.save(tuple.getT1()),
paymentUpdateRepository.save(tuple.getT2())))
.donOnNext(e -> log.info(e))
.map(Tuple2::getT1)
.map(this::toChargeTransactionDto);
I'm looking for an answer more related to once experience woking with project reactor on prod as this is my first time.
Thanks