Skip to main content

Spring Boot Set Root Logging Level

Sometimes it is nice to be able to see all debugging information from your spring boot application. I am not going to go over the various Java logging frameworks but rather the quick and easy way to set a logging level.

Logging Level Types

By default, ERROR, WARN and INFO level messages are logged. You can show more specific logs by explicitly setting the type. There are five main logging levels (NOTE: FATAL is mapped to ERROR so I am only counting five):

  1. ERROR
  2. WARN
  3. INFO
  4. DEBUG
  5. TRACE

Set Root Logging Level

When debugging it might be helpful to just set the root logging level to debug. Here are a couple of examples

Set logging level in application.properties


logging.level.root=DEBUG

Set logging level in application.yml


logging.level.root: DEBUG

As always, please comment with questions, suggestions, best practices, etc…

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *