代码之家  ›  专栏  ›  技术社区  ›  Anand Rockzz

在spring boot中记录。*的@ConfigurationProperties

  •  1
  • Anand Rockzz  · 技术社区  · 6 年前

    logging.* 在application.yml中?

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

    我尝试了上面的代码,但我正在寻找的代码没有列出。 spring-docs 没关系。找不到目标 source

    第一(具体)问题: 如何找到读取和自动配置日志记录的类。*属性?

    如何找到相应的 @ConfigurationProperties 对于spring boot中的特定模块?

    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
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   Andy Brown    6 年前

    Spring boot的日志类位于 org.springframework.boot.logging @ConfigurationProperties 您一直在搜索的方法。日志属性被传输到中的环境变量 LoggingSystemProperties logback XML config files .