]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4898 fix support of sonar.log.console
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 23 Jul 2014 14:58:56 +0000 (16:58 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 23 Jul 2014 14:59:06 +0000 (16:59 +0200)
server/sonar-server-app/src/main/java/org/sonar/server/app/Webapp.java
server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java

index b38469019947c85ca450e4f3fdf41d8d208964ce..5ad563df59c2f4094c28a83cb8a22680b00f20b9 100644 (file)
@@ -32,16 +32,12 @@ class Webapp {
   private static final String JRUBY_MAX_RUNTIMES = "jruby.max.runtimes";
   private static final String RAILS_ENV = "rails.env";
   private static final String PROPERTY_CONTEXT = "sonar.web.context";
-  private static final String PROPERTY_LOG_PROFILING_LEVEL = "sonar.log.profilingLevel";
-  private static final String PROPERTY_LOG_CONSOLE = "sonar.log.console";
 
   static void configure(Tomcat tomcat, Props props) {
     try {
       String webDir = props.of("sonar.path.web");
       Context context = tomcat.addWebapp(getContextPath(props), webDir);
       context.setConfigFile(new File(webDir, "META-INF/context.xml").toURI().toURL());
-      context.addParameter(PROPERTY_LOG_PROFILING_LEVEL, props.of(PROPERTY_LOG_PROFILING_LEVEL, "NONE"));
-      context.addParameter(PROPERTY_LOG_CONSOLE, props.of(PROPERTY_LOG_CONSOLE, "false"));
       for (Map.Entry<Object, Object> entry : props.cryptedProperties().entrySet()) {
         String key = entry.getKey().toString();
         if (key.startsWith("sonar.")) {
index 250832144d11a748918a6550f1d7a24fc722ee09..9cee68b12613526aaa5d51945507f08341503ad8 100644 (file)
@@ -91,14 +91,10 @@ public final class PlatformServletContextListener implements ServletContextListe
    */
   private void configureLogback(ServletContextEvent event) {
     String configProfilingLevel = defaultIfEmpty(
-      event.getServletContext().getInitParameter(Profiling.CONFIG_PROFILING_LEVEL),
-      System.getProperty(Profiling.CONFIG_PROFILING_LEVEL));
+      event.getServletContext().getInitParameter(Profiling.CONFIG_PROFILING_LEVEL), "NONE");
     Profiling.Level profilingLevel = Profiling.Level.fromConfigString(configProfilingLevel);
-    String consoleEnabled = defaultIfEmpty(defaultIfEmpty(
-        event.getServletContext().getInitParameter(CONFIG_LOG_CONSOLE),
-        System.getProperty(CONFIG_LOG_CONSOLE)),
-      // Line below used in last resort
-      "false");
+    String consoleEnabled = defaultIfEmpty(
+        event.getServletContext().getInitParameter(CONFIG_LOG_CONSOLE), "false");
     Map<String, String> variables = ImmutableMap.of(
       "LOGFILE_LOGGING_FORMAT", profilingLevel == Profiling.Level.FULL ? LOGFILE_FULL_LOGGING_FORMAT : LOGFILE_STANDARD_LOGGING_FORMAT,
       "CONSOLE_LOGGING_FORMAT", profilingLevel == Profiling.Level.FULL ? CONSOLE_FULL_LOGGING_FORMAT : CONSOLE_STANDARD_LOGGING_FORMAT,