我怎样才能让@SpringBootApplication(scanBasePackages...) 给出详细的跟踪输出? [英] How can I make @SpringBootApplication(scanBasePackages...) give verbose trace output?

查看:28
本文介绍了我怎样才能让@SpringBootApplication(scanBasePackages...) 给出详细的跟踪输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前的问题 说我应该使用

@SpringBootApplication(scanBasePackages = {"path.to.your.project.root", "path.to.your.library.root"})

从库 jar 包(使用 maven 构建)制作 Spring 加载组件.

to make Spring load components from library jar packages (built with maven).

这看起来应该是正确的答案,但它不起作用.

This looks like it should be the right answer but it isn't working.

我可以告诉 spring 详细打印出它正在扫描哪些路径以查找组件吗?

Can I tell spring to verbosely print out which paths it is scanning for components?

推荐答案

您可以在 application.properties 或 application.yml 中为每个包创建自定义日志记录级别.请查看此处的文档:https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-custom-log-levels

You can create custom logging level per packages inside your application.properties or application.yml. Please take a look into the documentation which is here: https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-custom-log-levels

你可以在那里声明,例如 application.properties

And you could declare there, for example application.properties

logging.level.org.springframework=trace

或 application.yml:

or application.yml:

logging:
  level:
    root: ERROR
    org.springframework: TRACE

这篇关于我怎样才能让@SpringBootApplication(scanBasePackages...) 给出详细的跟踪输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆