我在java应用程序中使用selenium-server和phantomjsdriver。
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
这会在我的控制台上生成3种不同的输出
现在的问题是
下面的示例输出
2232 [pool-1-thread-1] INFO com.opendi.util.selenium.service.PhantomJsService - New PhantomJS instance
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: executable: /home/michel/github/work/screencapture/bin/amd64/phantomjs
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: port: 11710
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: arguments: [--webdriver=11710]
2306 [pool-1-thread-2] INFO com.opendi.util.selenium.service.PhantomJsService - New PhantomJS instance
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: executable: /home/michel/github/work/screencapture/bin/amd64/phantomjs
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: port: 18873
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: arguments: [--webdriver=18873]
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: environment: {}
Oct 07, 2015 10:14:50 AM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: environment: {}
[INFO - 2015-10-07T08:14:50.392Z] GhostDriver - Main - running on port 18873
[INFO - 2015-10-07T08:14:50.421Z] GhostDriver - Main - running on port 11710
非常感谢一些帮助
答案 0 :(得分:0)
你的应用程序中你的记录器实现是什么我的意思是例如我使用一些时间log4j并将log4j.properties放在类路径上并定义下面的
log4j.rootLogger = INFO,R,STDOUT log4j.appender.STDOUT = org.apache.log4j.ConsoleAppender log4j.appender.STDOUT.layout = org.apache.log4j.PatternLayout log4j.appender.STDOUT.layout.ConversionPattern =%d {yyyy-MM-dd HH:mm:ss} %-5p%c {1}:%L - %m%n
log4j.appender.R.File = $ {的user.home} /mylogFile.log
log4j.logger.org.openqa.selenium = INFO,R