Return to site

🍃🎓 SPRING CERTIFICATION QUESTION: How can you control logging with Spring Boot?

· vcp,spring,java

Answer:

Even though Spring Boot is an 'opinionated' framework,

its true power comes with the possibility to customize each and every pre-configured layer.

When it comes to logging the following can be changed:

  • - log level of the core Spring loggers (container, Hibernate, Spring Boot):
    • -- specify --debug or --trace flag.
    • -- specify application property debug=true, trace=true.
  • - message color of console output.
  • - file output using logging.file or logging.path application property.
  • - logging level of specific classes or logging groups.
  • - specify different logging implementation by including libraries on the classpath (logback is used by default).

#spring #certificationquestion #vcp #logging