簡體   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