[英]logging.*'s @ConfigurationProperties in spring-boot
In Spring-boot, which class reads the logging.*
in application.yml ? 在Spring-boot中,哪个类读取application.yml中的
logging.*
?
for (String name : applicationContext.getBeanNamesForAnnotation(ConfigurationProperties.class)) {
System.out.println(name);
}
I tried the above code, but the one I'm looking for is not listed. 我尝试了上面的代码,但未找到我想要的代码。 spring-docs doesn't mention it.
spring-docs没有提及。 No luck searching the source .
搜寻来源并不幸运。
First (specific) question: how to find the class who reads and auto-configures logging.* properties? 第一个(特定的)问题:如何找到读取并自动配置logging。*属性的类?
Second (much wider) question: how to find the respective @ConfigurationProperties
for a specific module in spring-boot? 第二个(更广泛的)问题:如何在spring-boot中为特定模块找到各自的
@ConfigurationProperties
?
Output 产量
server-org.springframework.boot.autoconfigure.web.ServerProperties
spring.http-org.springframework.boot.autoconfigure.http.HttpProperties
spring.mvc-org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties
spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties
spring.resources-org.springframework.boot.autoconfigure.web.ResourceProperties
spring.jta-org.springframework.boot.autoconfigure.transaction.jta.JtaProperties
spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
spring.jpa.hibernate-org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties
spring.jpa-org.springframework.boot.autoconfigure.orm.jpa.JpaProperties
diskSpaceHealthIndicatorProperties
management.health.status-org.springframework.boot.actuate.autoconfigure.health.HealthIndicatorProperties
management.endpoint.health-org.springframework.boot.actuate.autoconfigure.health.HealthEndpointProperties
management.endpoint.configprops-org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointProperties
management.endpoints.jmx-org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointProperties
management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
management.endpoint.env-org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointProperties
spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties
management.info-org.springframework.boot.actuate.autoconfigure.info.InfoContributorProperties
management.endpoint.logfile-org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointProperties
management.metrics-org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties
management.metrics.export.simple-org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleProperties
management.trace.http-org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceProperties
spring.gson-org.springframework.boot.autoconfigure.gson.GsonProperties
spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties
spring.data.rest-org.springframework.boot.autoconfigure.data.rest.RepositoryRestProperties
spring.hateoas-org.springframework.boot.autoconfigure.hateoas.HateoasProperties
spring.jdbc-org.springframework.boot.autoconfigure.jdbc.JdbcProperties
spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties
spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties
spring.servlet.multipart-org.springframework.boot.autoconfigure.web.servlet.MultipartProperties
spring.devtools-org.springframework.boot.devtools.autoconfigure.DevToolsProperties
management.endpoints.web.cors-org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties
management.server-org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties
Spring boot's logging classes are in the org.springframework.boot.logging
package. Spring Boot的日志记录类位于
org.springframework.boot.logging
包中。 It doesn't work using the @ConfigurationProperties
method that you've been searching for. 使用您一直在搜索的
@ConfigurationProperties
方法不起作用。 Logging properties are transferred to environment variables in the LoggingSystemProperties
class and then those environment variables are referenced in the provider's configuration file, eg the logback XML config files . 日志记录属性被传输到
LoggingSystemProperties
类中的环境变量,然后在提供者的配置文件(例如, logback XML配置文件)中引用这些环境变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.