Logging with Spring Cloud Stream

To wrap things up, it would be nice to actually see how Spring Cloud Stream is handling things. To do so, we can dial up the log levels in application.yml like this:

    logging: 
       level: 
        org: 
          springframework: 
            cloud: DEBUG 
            integration: DEBUG 

This last code dials up the log levels for both Spring Cloud Stream and its underlying technology, Spring Integration. It's left as an exercise for the reader to change RabbitTemplate log levels by setting org.springframework.amqp=DEBUG and see what happens.

With these levels dialed up, if we run our application, we can see a little of this:

This previous screenshot shows a clear separation between Spring Cloud Stream involved in binding compared to Spring Integration dealing with channel settings as well as setting up AMQP exchanges and queues.

It's also nice to observe that the logging prefix o.s.c.s is short for org.springframework.cloud.stream or Spring Cloud Stream.

If we add a new comment on the web page, we can see the outcome, as seen here:

This screenshot nicely shows Comment being transmitted to the output channel and then received on the input channel later.

Also notice that the logging prefix o.s.i indicates Spring Integration, with s.i.m being Spring Integration's Message API.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.237.201