Index: src/main/java/hudson/plugins/selenium/PluginImpl.java =================================================================== --- src/main/java/hudson/plugins/selenium/PluginImpl.java (revision 27497) +++ src/main/java/hudson/plugins/selenium/PluginImpl.java (working copy) @@ -48,6 +48,7 @@ import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; +import java.util.logging.Level; /** * Starts Selenium Grid server in another JVM. @@ -64,6 +65,7 @@ private boolean rcTrustAllSSLCerts; private String rcFirefoxProfileTemplate; private String rcLog; + private String hubLogLevel = "INFO"; /** * Channel to Selenium Grid JVM. @@ -77,7 +79,8 @@ StreamTaskListener listener = new StreamTaskListener(getLogFile()); File root = Hudson.getInstance().getRootDir(); channel = createSeleniumGridVM(root, listener); - hubLauncher = channel.callAsync(new HubLauncher(port)); + Level logLevel = hubLogLevel != null ? Level.parse(hubLogLevel) : Level.INFO; + hubLauncher = channel.callAsync(new HubLauncher(port, logLevel)); Hudson.getInstance().getActions().add(this); } @@ -95,6 +98,7 @@ rcBrowserSideLog = formData.getBoolean("rcBrowserSideLog"); rcTrustAllSSLCerts = formData.getBoolean("rcTrustAllSSLCerts"); rcFirefoxProfileTemplate = formData.getString("rcFirefoxProfileTemplate"); + hubLogLevel = formData.getString("hubLogLevel"); try { save(); } catch (IOException e) { @@ -157,6 +161,10 @@ return rcFirefoxProfileTemplate; } + @Exported + public String getHubLogLevel(){ + return hubLogLevel != null ? hubLogLevel : "INFO"; + } public void stop() throws Exception { channel.close(); Index: src/main/java/hudson/plugins/selenium/HubLauncher.java =================================================================== --- src/main/java/hudson/plugins/selenium/HubLauncher.java (revision 27497) +++ src/main/java/hudson/plugins/selenium/HubLauncher.java (working copy) @@ -14,6 +14,8 @@ import org.mortbay.jetty.servlet.ServletHolder; import java.lang.reflect.Field; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Starts the selenium grid server. @@ -23,10 +25,12 @@ * @author Kohsuke Kawaguchi */ public class HubLauncher implements Callable { - private int port; + private final int port; + private final Level logLevel; - public HubLauncher(int port) { + public HubLauncher(int port, Level logLevel) { this.port = port; + this.logLevel = logLevel; } public Void call() throws Exception { @@ -52,6 +56,7 @@ final Server server; final Context root; + configuration = HubRegistry.registry().gridConfiguration().getHub(); server = new Server(configuration.getPort()); @@ -68,5 +73,8 @@ root.addServlet(new ServletHolder(new LifecycleManagerServlet()), "/lifecycle-manager"); server.start(); + + Logger.getLogger("com.thoughtworks.selenium").setLevel(logLevel); + Logger.getLogger("org.apache.commons.httpclient").setLevel(logLevel); } } Index: src/main/resources/hudson/plugins/selenium/PluginImpl/config.jelly =================================================================== --- src/main/resources/hudson/plugins/selenium/PluginImpl/config.jelly (revision 27497) +++ src/main/resources/hudson/plugins/selenium/PluginImpl/config.jelly (working copy) @@ -22,6 +22,13 @@ + + + \ No newline at end of file Index: src/main/webapp/help/hubloglevel.html =================================================================== --- src/main/webapp/help/hubloglevel.html (revision 0) +++ src/main/webapp/help/hubloglevel.html (revision 0) @@ -0,0 +1,6 @@ +
+ Selenium Hub can create excessive amount of log messages in the + $HUDSON_HOME/selenium.log on INFO level. Set this to + SEVERE level to reduce the Selenium Hub Disk usage. + The changes will be applied on the next Hudson start. +
\ No newline at end of file Property changes on: src/main/webapp/help/hubloglevel.html ___________________________________________________________________ Added: svn:mime-type + text/html