programing

Spring 부트애플리케이션 콘솔에서 상태 평가 보고서를 제외하려면 어떻게 해야 합니까?

oldcodes 2023. 3. 20. 23:35
반응형

Spring 부트애플리케이션 콘솔에서 상태 평가 보고서를 제외하려면 어떻게 해야 합니까?

Spring 부트애플리케이션을 실행하면 콘솔로그에 상태 평가 보고서가 표시됩니다.

스프링 부트 시 콘솔로그에서 이 보고서를 비활성화 또는 제외하려면 어떻게 해야 합니까?

============================
CONDITIONS EVALUATION REPORT
============================


Positive matches:
-----------------

   AopAutoConfiguration matched:
      - @ConditionalOnClass found required classes 'org.springframework.context.annotation.EnableAspectJAutoProxy', 'org.aspectj.lang.annotation.Aspect', 'org.aspectj.lang.reflect.Advice', 'org.aspectj.weaver.AnnotatedElement'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
      - @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)

   AopAutoConfiguration.CglibAutoProxyConfiguration matched:
      - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)

   CacheAutoConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.cache.CacheManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
      - @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) found bean 'cacheInterceptor'; @ConditionalOnMissingBean (names: cacheResolver; types: org.springframework.cache.CacheManager; SearchStrategy: all) did not find any beans (OnBeanCondition)

...

이 작업은 로그 수준을 변경하여 수행할 수 있습니다.org.springframework.boot.autconfigure예를 들어, 다음 행을 에 추가합니다.application.properties:

logging.level.org.springframework.boot.autoconfigure=ERROR

다음과 같은 경우 상태 결과 보고서가 표시됩니다.

  • 디버깅 출력을 표시하도록 IDE를 설정합니다(예를 들어 IntelliJ의 스프링 부트 실행 구성 내에서 디버깅 출력을 유효하게 하는 경우).
  • 속성 설정debug=trueapplication.properties 내에 있습니다.
  • 로깅 수준을 설정합니다.org.springframework.boot.autoconfigure.logging로.DEBUG.

이 보고서는 어떤 자동 구성이 로드되고 있는지, 어떤 자동 구성이 로드되지 않았는지(왜 로드되지 않았는지) 정확하게 확인할 수 있기 때문에 특정 콩이 로드되지 않은 이유를 찾는 데 유용합니다.

앞서 언급한 글머리 기호를 취소하여 이 출력을 비활성화할 수 있습니다.예를 들어 로그 수준을 설정할 수 있습니다.org.springframework.boot.autoconfigure.logging로.INFO:

logging.level.org.springframework.boot.autoconfigure.logging=INFO

다른 답변은 동작하지만 로그 수준을 다음과 같이 설정할 수도 있습니다.INFO:

logging.level.org.springframework.boot.autoconfigure=INFO

application.yml에 다음을 추가합니다.

logging:
  level:
    ROOT: INFO
    you/package/path: INFO

application.yml이 있는 경우 답변은 다음과 같습니다.

logging:
  level:
    org.springframework.boot: ERROR

언급URL : https://stackoverflow.com/questions/50273570/how-can-i-exclude-the-conditions-evaluation-report-from-the-console-of-a-spring

반응형