如何在嵌入式Glassfish的得到的server.log
-
27-09-2019 - |
题
我使用的是嵌入式的Glassfish做一些容器内,用测试的Arquillian。现在,当我的测试失败,我总是得到来自堆满特定的Arquillian-东西测试踪迹。但也有关于什么的测试失败的真正原因是一些信息。 通过定期Glassfish的,我可以查看server.log更多的信息。不幸的是,嵌入式Glassfish的似乎不提供server.log中。 我也看了成/嵌入式Glassfish的由的Arquillian创建的临时目录,但它不包含任何日志文件。
我怎样才能激活嵌入式Glassfish的记录?
顺便说,我在我的POM下列相关性:
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3</artifactId>
<version>1.0.0.Alpha4</version>
</dependency>
<dependency>
<groupId>org.glassfish.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>3.1-b06</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-testng</artifactId>
<version>1.0.0.Alpha4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
解决方案
我有很多困难的与恰好使用的Arquillian,TestNG的和嵌入式GlassFish中同样的问题。几个小时后,我设法得到它的工作。
我发现的是,具有的Arquillian它使用SLF4J-API上SLF4J-简单的1.5.9.RC1版本的依赖关系。
要得到它的工作我添加的属性。
<properties>
<version.slf4j>1.5.9.RC1</version.slf4j>
</properties>
和依赖
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
和然后在依赖关系管理
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${version.slf4j}</version>
</dependency>
</dependencies>
</dependencyManagement>
一旦我有这个我加我平时log4j.properties文件为src /测试/资源和一切工作正常。
干杯
不隶属于 StackOverflow