我正在尝试在此之后使用码头的 logback 访问 但是我在启动服务器时遇到了这个异常:
配置错误 | logback.xml | java.lang.ClassNotFoundException: ch.qos.logback.access.jetty.RequestLogImpl
这是 jetty.xml 中导致问题的代码:
<Ref id="RequestLogHandler">
<Set name="requestLog">
<New id="requestLogImpl" class="ch.qos.logback.access.jetty.RequestLogImpl">
<Set name="resource">as/classpath/resource/myaccess.xml</Set>
</New>
</Set>
</Ref>
这是 pom.xml
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.0.13</version>
</dependency>
</dependencies>
<build>
<finalName>oslc4j-jira-sample</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webAppConfig>
<contextPath>/OSLC4JJira</contextPath>
</webAppConfig>
<!-- Jetty config adds logging -->
<jettyConfig>${project.build.directory}/classes/jetty.xml</jettyConfig>
<!-- enable hot deploy -->
<reload>automatic</reload>
<scanIntervalSeconds>5</scanIntervalSeconds>
<scanTargets>
<scanTarget>WebContent</scanTarget>
</scanTargets>
<systemProperties>
<systemProperty>
<name>config.dir</name>
<value>${basedir}/src/test/resources</value>
</systemProperty>
<systemProperty>
<name>jetty.logs</name>
<value>${basedir}/target</value>
</systemProperty>
<systemProperty>
<name>jetty.port</name>
<value>8080</value>
</systemProperty>
</systemProperties>
<webResources>
<resource>
<directory>${build.sourceDirectory}</directory>
<targetPath>sources</targetPath>
</resource>
</webResources>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
</dependency>
</dependencies>
</configuration>
</plugin>
</plugins>