Logging can be used to monitor your application flow, and it is a good way to capture unexpected errors in your program code. Spring Boot starter packages provide a logback that we can use for logging without any configuration. The following sample code shows how you can use logging: