我们正在使用dozer,每次测试运行时都会创建一个推土机映射的实例(或者看起来如此,我不是硬核推土机人)。这在运行单元测试时会在控制台中产生大量垃圾(见下文)。我们如何关闭它?完全关闭。
我们使用Maven作为构建工具,因此属性文件更可取。我试图加载logging.properties而没有任何运气(我们也使用java.util.logging.Logger)
我试图查看this(使用程序化方法),但我们有很多测试,因此添加到所有测试中几乎是不可能的。
非常感谢任何提示/技巧!
输出示例 - 行数达到数千,这使构建变慢:
2640 [main] INFO org.dozer.DozerBeanMapper - 试图找到xml映射文件:dozerServicesEjb / dozerBeanMapper.xml
2642 [main] INFO org.dozer.DozerBeanMapper - 使用URL [file:/ C:/development/core-services/services.ejb/target/classes/dozerServicesEjb/dozerBeanMapper.xml]加载自定义xml映射
2654 [main] INFO org.dozer.DozerBeanMapper - 从URL成功加载自定义xml映射:[file:/ C:/development/core-services/services.ejb/target/classes/dozerServicesEjb/dozerBeanMapper.xml] < / p>
2654 [main] INFO org.dozer.DozerBeanMapper - 尝试查找xml映射文件:dozerServicesEjb / AccountArrangementMapping.xml
2655 [main] INFO org.dozer.DozerBeanMapper - 使用URL [file:/ C:/development/core-services/services.ejb/target/classes/dozerServicesEjb/AccountArrangementMapping.xml]加载自定义xml映射
2683 [main] INFO org.dozer.DozerBeanMapper - 从URL成功加载自定义xml映射:[file:/ C:/development/core-services/services.ejb/target/classes/dozerServicesEjb/AccountArrangementMapping.xml] < / p>
2684 [main] INFO org.dozer.DozerBeanMapper - 尝试查找xml映射文件:dozerServicesEjb / AddressMapping.xml
2685 [main] INFO org.dozer.DozerBeanMapper - 使用URL [file:/ C:/development/core-services/services.ejb/target/classes/dozerServicesEjb/AddressMapping.xml]加载自定义xml映射
2697 [main] INFO org.dozer.DozerBeanMapper - 从URL成功加载自定义xml映射:[file:/ C:/development/core-services/services.ejb/target/classes/dozerServicesEjb/AddressMapping.xml] < / p>
...
答案 0 :(得分:0)
将log4j.properties
文件放入src/test/resources
,以禁用org.dozer
记录器。
log4j.logger.org.dozer=OFF