logback
  • janino
  • 2015-01-07 4 views 2 likes 
    2

    janino의 조건부 처리를 사용하여 중복 로그백 구성 파일을 제거하려고합니다. 다음은 로그백 구성의 조건

    내가

    <root level="INFO">  
        <appender-ref ref="ROLLING" /> 
        <!-- use console appender on windows, email appender on linux --> 
        <if condition='property("os.name").contains("win")'> 
         <then> 
          <appender-ref ref="CONSOLE" /> 
         </then> 
         <else> 
          <appender-ref ref="EMAIL" /> 
         </else> 
        </if>  
    </root> 
    

    추가했다 조건부 로직하지만

    같은 것을 조건부 논리를 제거하고 사용하는 경우이 아래 오류

    12:30:34,877 |-ERROR in [email protected]:55 - no applicable action for [if], current pattern is [[configuration][root][if]] 
    12:30:34,877 |-ERROR in [email protected]:10 - no applicable action for [then], current pattern is [[configuration][root][if][then]] 
    12:30:34,877 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current pattern is [[configuration][root][if][then][appender-ref]] 
    12:30:34,877 |-ERROR in [email protected]:10 - no applicable action for [else], current pattern is [[configuration][root][if][else]] 
    12:30:34,877 |-ERROR in [email protected]:35 - no applicable action for [appender-ref], current pattern is [[configuration][root][if][else][appender-ref]] 
    

    구성이 잘 작동을 던졌습니다

    <root level="INFO">  
        <appender-ref ref="ROLLING" /> 
        <appender-ref ref="CONSOLE" /> 
        <appender-ref ref="EMAIL" />   
    </root> 
    

    어떻게하면 올바르게 구성 할 수 있습니까? ppender는 Windows에서만 사용되며 EMAIL appender는 다른 곳에서 사용됩니까?

    +0

    사용하는 로그백 라이브러리 버전은 무엇입니까? –

    +0

    버전 0.9.17의 로그백 및 slf4j의 버전 1.5.8 – coderplus

    +1

    최신 버전을 사용해 볼 수 있습니까? 최신 버전을 사용하고 위 조건문은 완벽하게 작동합니다. –

    답변

    1

    최신 버전을 사용해 볼 수 있습니까? 최신 버전을 사용하고 위의 조건문은 완벽하게 작동합니다.

    +0

    여기에 대한 자세한 정보 http://logback.qos.ch/setup.html#janino 2.7.8이 하나입니다. –

     관련 문제

    • 관련 문제 없음^_^