Remove “Using default security password” on Spring Boot

后端 未结 18 2174
小鲜肉
小鲜肉 2020-12-04 12:13

I added one custom Security Config in my application on Spring Boot, but the message about \"Using default security password\" is still there in LOG file.

Is there a

18条回答
  •  失恋的感觉
    2020-12-04 12:19

    In a Spring Boot 2 application you can either exclude the service configuration from autoconfiguration:

    spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration
    

    or if you just want to hide the message in the logs you can simply change the log level:

    logging.level.org.springframework.boot.autoconfigure.security=WARN
    

    Further information can be found here: https://docs.spring.io/spring-boot/docs/2.0.x/reference/html/boot-features-security.html

提交回复
热议问题