From b7d09c38a8ffd827142b271eb3eb4635058226f2 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 23 Jul 2014 16:58:56 +0200 Subject: [PATCH] SONAR-4898 fix support of sonar.log.console --- .../src/main/java/org/sonar/server/app/Webapp.java | 4 ---- .../platform/PlatformServletContextListener.java | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/server/sonar-server-app/src/main/java/org/sonar/server/app/Webapp.java b/server/sonar-server-app/src/main/java/org/sonar/server/app/Webapp.java index b3846901994..5ad563df59c 100644 --- a/server/sonar-server-app/src/main/java/org/sonar/server/app/Webapp.java +++ b/server/sonar-server-app/src/main/java/org/sonar/server/app/Webapp.java @@ -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 entry : props.cryptedProperties().entrySet()) { String key = entry.getKey().toString(); if (key.startsWith("sonar.")) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java b/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java index 250832144d1..9cee68b1261 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/PlatformServletContextListener.java @@ -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 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, -- 2.39.5