In this post, I would demo how to solve org.springframework.boot.context.properties.bind.BindException:failed to bind properties under logging.level to java.util.Map.
3. The Exception
When we define the application.properties like this:
If we restart the Springboot application,we would get this exception:
4. How to solve this problem?
4.1 Add a logger
The problem is triggered by commenting the only non-root-logger, so we add it again:
Start the app, everything is ok.
4.2 Change the root logger
If you don’t want the logger, and you can just change your root logger like this:
Start the app, everything is still ok.
5. Why did this happen?
According to the SpringBoot document,For SpringBoot 2,you should specify the logger name:
SpringBoot2 use logging.level.= where level is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, or OFF. ...
For SpringBoot 1.x, you can skip the logger name by using wildcard:
SpringBoot 1.x use logging.level.*=LEVEL where ‘LEVEL’ is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF…
Be careful if you switch from SpringBoot 1.x to 2.x.