May 2019
Intermediate to advanced
316 pages
7h 13m
English
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:
import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class CardatabaseApplication { private static final Logger logger = LoggerFactory.getLogger(CardatabaseApplication.class); public static void main(String[] args) { SpringApplication.run(CardatabaseApplication.class, args); logger.info("Hello Spring Boot"); }}
Logging messages can be seen in the console after you run the project:
There are seven different levels ...
Read now
Unlock full access