繁体   English   中英

spring-boot中的logging。*的@ConfigurationProperties

[英]logging.*'s @ConfigurationProperties in spring-boot

在Spring-boot中,哪个类读取application.yml中的logging.*

for (String name : applicationContext.getBeanNamesForAnnotation(ConfigurationProperties.class)) {
            System.out.println(name);
        }

我尝试了上面的代码,但未找到我想要的代码。 spring-docs没有提及。 搜寻来源并不幸运。

第一个(特定的)问题:如何找到读取并自动配置logging。*属性的类?

第二个(更广泛的)问题:如何在spring-boot中为特定模块找到各自的@ConfigurationProperties

产量

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的日志记录类位于org.springframework.boot.logging包中。 使用您一直在搜索的@ConfigurationProperties方法不起作用。 日志记录属性被传输到LoggingSystemProperties类中的环境变量,然后在提供者的配置文件(例如, logback XML配置文件)中引用这些环境变量。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM