2016-06-02 4 views
0

내 프로젝트는 handlebars-proto를 사용하여 템플릿을 json에 바인딩합니다. 또한 logstash에 대한 Json의 형태로 로그인 logstash - logback - 인코더를 사용하려고합니다. 다음은 (다른 의존성과 함께) 내 컴파일 의존성입니다.Handlebars-proto 및 logstash-logback-encoder slf4j conflict

compile 'net.logstash.logback:logstash-logback-encoder:4.6' 
    compile 'com.github.jknack:handlebars-proto:4.0.5' 

핸들 바 종속성 로깅을 제거해도 문제가 없습니다. 핸들이 있으면 나는 아래의 경고를 얻을 :

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/manish/.gradle/caches/modules-2/files-2.1/com.github.jknack/handlebars-proto/4.0.5/5979737344d99e0d8b482e828f247ae86fd0113/handlebars-proto-4.0.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/manish/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.1.6/665e3de72f19ec66ac67d82612d7b8e6b3de3cd0/logback-classic-1.1.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

오류 다음 :

Failed to instantiate [ch.qos.logback.classic.LoggerContext] Reported exception: java.lang.NoSuchMethodError: ch.qos.logback.core.spi.ContextAwareBase.(Lch/qos/logback/core/spi/ContextAware;)V at net.logstash.logback.composite.CompositeJsonFormatter.(CompositeJsonFormatter.java:106) at net.logstash.logback.composite.loggingevent.LoggingEventCompositeJsonFormatter.(LoggingEventCompositeJsonFormatter.java:28) at net.logstash.logback.LogstashFormatter.(LogstashFormatter.java:122) at net.logstash.logback.LogstashFormatter.(LogstashFormatter.java:118) at net.logstash.logback.LogstashFormatter.(LogstashFormatter.java:114) at net.logstash.logback.encoder.LogstashEncoder.createFormatter(LogstashEncoder.java:31) at net.logstash.logback.encoder.CompositeJsonEncoder.(CompositeJsonEncoder.java:48) at net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder.(LoggingEventCompositeJsonEncoder.java:23) at net.logstash.logback.encoder.LogstashEncoder.(LogstashEncoder.java:27) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.begin(NestedComplexPropertyIA.java:122) at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)

내가 전이 핸들에서 의존하지만 도움이되지 않았다 으로 SLF4J를 제외했습니다.

미리 도움을 청하십시오. 자세한 내용이 필요한 경우 알려 주시기 바랍니다.

답변

0

오류 메시지는 handlebars-proto jar에 org.slf4j.impl.StaticLoggerBinder 구현이 포함되어있어 로깅 구현이 있다는 것을 의미합니다. Logback의 자체 로깅 구현을 추가하려고 시도하고 있으며 SLF4J는 한 번에 두 개의 로깅 시스템을 사용할 수 없으므로 불평합니다.

나는 handlebars 프로젝트에 익숙하지 않지만 로깅 시스템을 포함하고 다른 프로젝트의 종속성으로 사용되도록 설계되지 않은 완전한 응용 프로그램이 있다고 생각합니다. 아마도 라이브러리와 다른 로깅 구현을 포함하지 않는 다른 버전을 사용할 수 있습니까?

+0

감사합니다. 나는 핸들 바 proto에서 핸들 바에 바뀌었다 : 4.0.5. 지금은 잘 작동합니다. – Manish