*/
package org.sonar.server.app;
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
import com.google.common.base.Throwables;
import java.io.File;
import java.util.concurrent.CountDownLatch;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Tomcat;
+import org.slf4j.LoggerFactory;
import org.sonar.api.utils.log.Loggers;
import org.sonar.process.Props;
TomcatConnectors.configure(tomcat, props);
webappContext = new TomcatContexts().configure(tomcat, props);
try {
+ // let Tomcat temporarily log errors at start up - for example, port in use
+ Logger logger = (Logger) LoggerFactory.getLogger("org.apache.catalina.core.StandardService");
+ logger.setLevel(Level.ERROR);
tomcat.start();
+ logger.setLevel(Level.OFF);
new TomcatStartupLogs(Loggers.get(getClass())).log(tomcat);
} catch (LifecycleException e) {
Loggers.get(EmbeddedTomcat.class).error("Fail to start web server", e);