Logging reactive operations

So far, we have crafted a domain object for MongoDB, defined a reactive repository, and updated our ImageService to use it. If we fire things up, though, how can we see what's happening? Apart from viewing the web page, what can we expect to see in the console logs?

So far, this appears to be the most we get:

We see some log messages about connecting to an instance of MongoDB, but that's it! Not much there to debug things, ehh? Never fear, Spring Boot to the rescue.

Spring Boot comes with extensive logging support. Off the cuff, we can create a logback.xml file, and add it to our configuration in src/main/resources ...

Get Learning Spring Boot 2.0 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.