@@ -1,9 +1,16 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!-- | |||
See http://logback.qos.ch/access.html#configuration | |||
Log HTTP requests in the file logs/access.log | |||
See http://logback.qos.ch/access.html#configuration | |||
--> | |||
<configuration debug="false"> | |||
<!-- Required for performance reason. See http://www.slf4j.org/legacy.html#jul-to-slf4j --> | |||
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/> | |||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
@@ -1,5 +1,11 @@ | |||
<?xml version="1.0" encoding="UTF-8" ?> | |||
<!-- | |||
Logging configuration. | |||
By default logs are generated in logs/sonar.log. | |||
See http://logback.qos.ch/manual/configuration.html | |||
--> | |||
<configuration debug="false"> | |||
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/> | |||
@@ -21,7 +27,7 @@ | |||
</encoder> | |||
</appender> | |||
<!-- Display Rails warnings and errors in the standard Sonar log --> | |||
<!-- Display Rails warnings and errors --> | |||
<logger name="rails" additivity="false"> | |||
<level value="WARN"/> | |||
<appender-ref ref="SONAR_FILE"/> |
@@ -35,9 +35,6 @@ class Connectors { | |||
configureShutdown(tomcat, props); | |||
Connector connector = new Connector("HTTP/1.1"); | |||
// TODO manage redirects from other ports ? | |||
connector.setPort(props.intOf("sonar.web.port", 9000)); | |||
connector.setURIEncoding("UTF-8"); | |||
configurePool(props, connector); |
@@ -47,6 +47,9 @@ class EmbeddedTomcat { | |||
// See Ruby on Rails url_for | |||
System.setProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "true"); | |||
// Required for webapp and logback xml files | |||
System.setProperty("SONAR_HOME", env.rootDir().getAbsolutePath()); | |||
tomcat = new Tomcat(); | |||
// Initialize directories |
@@ -31,5 +31,6 @@ import java.util.Set; | |||
class NullJarScanner implements JarScanner { | |||
@Override | |||
public void scan(ServletContext context, ClassLoader classloader, JarScannerCallback callback, Set<String> jarsToSkip) { | |||
// doing nothing is fast! | |||
} | |||
} |
@@ -20,7 +20,6 @@ | |||
package org.sonar.application; | |||
// TODO dev mode | |||
// TODO sanitize jetty dependencies | |||
// TODO remove logback/slf4j from sonar-server | |||
public final class StartServer { |
@@ -27,9 +27,8 @@ class Webapp { | |||
static void configure(Tomcat tomcat, Env env, Props props) { | |||
String ctx = props.of("sonar.web.context", "/"); | |||
try { | |||
System.setProperty("SONAR_HOME", env.rootDir().getAbsolutePath()); | |||
Context context = tomcat.addWebapp(ctx, env.file("web").getAbsolutePath()); | |||
context.setConfigFile(env.file("web/META-INF/context.xml").toURL()); | |||
context.setConfigFile(env.file("web/META-INF/context.xml").toURI().toURL()); | |||
context.setJarScanner(new NullJarScanner()); | |||
} catch (Exception e) { |