从版本2.37左右开始,webdriver-java已经开始广泛记录,它填满了日志。我一直试图调查如何拒绝日志记录,但到目前为止没有运气。有人知道如何设置吗?
当前日志的输出:
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.impl.conn.DefaultClientConnection:Receiving response: HTTP/1.1 200 OK
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.headers:<< HTTP/1.1 200 OK
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.headers:<< content-type: application/json; charset=UTF-8
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.headers:<< connection: close
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.headers:<< content-length: 93
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.headers:<< server: httpd.js
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.headers:<< date: Mon, 06 Jan 2014 15:23:44 GMT
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.wire:<< "{"name":"addCookie","sessionId":"81e0107f-bb03-494e-b23a-d878402eb735","status":0,"value":""}"
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.impl.conn.DefaultClientConnection:Connection 0.0.0.0:23053<->127.0.0.1:7055 shut down
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager:Released connection is not reusable.
DEBUG 01-06 17:23:44 Forwarding addCookie on session 81e0107f-bb03-494e-b23a-d878402eb735 to remote--org.apache.http.impl.conn.tsccm.ConnPoolByRoute:Releasing connection [{}->http://127.0.0.1:7055][null]
这样的数千行。
编辑: 我找到了LoggingPreferences类,但它没有改变任何东西:
LoggingPreferences loggingPreferences = new LoggingPreferences();
loggingPreferences.enable(LogType.DRIVER, Level.WARNING);
loggingPreferences.enable(LogType.BROWSER, Level.WARNING);
loggingPreferences.enable(LogType.CLIENT, Level.WARNING);
capabilities.setCapability(CapabilityType.LOGGING_PREFS, loggingPreferences);
答案 0 :(得分:0)
实际上是Browsermob代理填充日志。 我回到 net.lightbody.bmp:browsermob-proxy:2.0-beta-8 ,并且每个人都恢复正常。