logging - SLF4J multiple bindings error on jetty 9 embedded webapp when trying to log jetty logs -
i try build standalone version (executable jar) of webapp. use jetty load war file. war file contains slf4j , logback dependencies. in standalone app have logback.xml
define logger definitions.
<?xml version="1.0" encoding="utf-8"?> <configuration> <appender name="app" class="ch.qos.logback.core.fileappender"> <file>/tmp/app.log</file> <encoder> <pattern>%d{yyyy-mm-dd hh:mm:ss.sss} [%thread] %-5level %logger{36} - %msg%n</pattern> </encoder> </appender> <root level="${log.level}"> <appender-ref ref="app"/> </root> </configuration>
this works fine, still output logging information jetty on console instead of logging file (all of app logging goes log file). in jetty documentation found need include logging framework in embedding app. included slf4j , logback, slf4j: class path contains multiple slf4j bindings. error , not log files.
how can fix this?
versions:
- jetty: 9.0.1.v20130408
- logback: 1.0.7
- slf4j: 1.7.2
in embedded mode controlling everything.
if single webapp, remove dupliate jar files, , consider setting webappcontext.setparentloaderpriority(true)
, using 1 classloader.
Comments
Post a Comment