Partner – Trifork – NPI (cat=Spring Boot)
announcement - icon

Navigating the complexities of Spring can be difficult, even for seasoned developers.

If you need direct, practical help and guidance with your own Spring work, Trifork's CTO, Joris Kuipers, is running a closed-door call.

It's free, but it's limited to only 3 seats, so if you need it, I would join quickly and be sure to attend:

>>> CTO Spring Open Office Hour Session - Technical Guidance

With more than 15 years of leading custom software development projects involving Spring, Joris has gained a lot of real-world experience, and this call is about sharing and helping the community.


Course – LS – All

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:


1. Overview

Spring Boot provides many auto-configurations to facilitate writing enterprise applications. However, it was always a bit cumbersome to apply the same logging configuration to a set of loggers.

In this quick tutorial, we're going to see how the new log groups feature is going to fix this issue.

2. Log Groups

As of Spring Boot 2.1, it's possible to group multiple loggers together and then configure them at the same time.

In order to use this feature, first, we should declare a group via the configuration property:,org.springframework.web,org.springframework.http

Here we're creating a group named rest containing three different logger names. Grouping loggers is as simple as separating their respective logger names with a comma.

Then we can apply configurations to all loggers in a group at once. For instance, here we're changing the log level for this group to debug:

As a result, Spring Boot applies the same log level for all three group members.

2.1. Built-in Groups

By default, Spring Boot comes with two built-in groups: sql and web. 

Currently, the web group consists of the following loggers:

  • org.springframework.core.codec
  • org.springframework.http
  • org.springframework.web
  • org.springframework.boot.actuate.endpoint.web
  • org.springframework.boot.web.servlet.ServletContextInitializerBeans

Similarly, the sql group contains the following loggers:

  • org.springframework.jdbc.core
  • org.hibernate.SQL

Configuring the log level for either of these groups would be applied to all group members automatically.

3. Conclusion

In this short article, we familiarized ourselves with the log groups in Spring Boot. This feature enables us to apply a log configuration to a set of loggers at once.

As usual, the sample code is available over on GitHub.

Course – LS – All

Get started with Spring 5 and Spring Boot 2, through the Learn Spring course:

res – REST with Spring (eBook) (everywhere)
Comments are closed on this article!