summaryrefslogtreecommitdiffstats
path: root/sonar-application
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2013-11-29 18:38:08 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2013-12-02 15:54:24 +0100
commit5b589e7dafef7897ac8df900ff4094d969ebe75d (patch)
tree151a0a574340dee7babd33d5f2170f8a82c16473 /sonar-application
parent1ccbf0b67e76b59522cfacb7075aff05e482a4d5 (diff)
downloadsonarqube-5b589e7dafef7897ac8df900ff4094d969ebe75d.tar.gz
sonarqube-5b589e7dafef7897ac8df900ff4094d969ebe75d.zip
SONAR-4756 Move log level configuration to sonar-server - WIP
Diffstat (limited to 'sonar-application')
-rw-r--r--sonar-application/src/main/assembly/conf/logback.xml107
-rw-r--r--sonar-application/src/main/java/org/sonar/application/Webapp.java2
2 files changed, 2 insertions, 107 deletions
diff --git a/sonar-application/src/main/assembly/conf/logback.xml b/sonar-application/src/main/assembly/conf/logback.xml
deleted file mode 100644
index 311233b7354..00000000000
--- a/sonar-application/src/main/assembly/conf/logback.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?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"/>
-
- <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <File>${SONAR_HOME}/logs/sonar.log</File>
- <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
- <param name="FileNamePattern" value="${SONAR_HOME}/logs/sonar.%i.log"/>
- <param name="MinIndex" value="1"/>
- <param name="MaxIndex" value="3"/>
- </rollingPolicy>
- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
- <param name="MaxFileSize" value="5MB"/>
- </triggeringPolicy>
- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
- <!-- Use %d{yyyy.MM.dd HH:mm:ss.SSS} to display milliseconds -->
- <pattern>
- %d{yyyy.MM.dd HH:mm:ss} %-5level %thread [%logger{20}] %X %msg%n
- </pattern>
- </encoder>
- </appender>
-
- <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
- <pattern>
- %d{yyyy.MM.dd HH:mm:ss} %-5level %msg%n
- </pattern>
- </encoder>
- </appender>
-
- <logger name="console" additivity="false">
- <level value="INFO"/>
- <appender-ref ref="CONSOLE"/>
- </logger>
-
- <!-- Display Rails warnings and errors -->
- <logger name="rails">
- <level value="WARN"/>
- </logger>
-
- <logger name="org.hibernate.cache.ReadWriteCache">
- <!-- removing "An item was expired by the cache while it was locked (increase your cache timeout)" msg -->
- <level value="ERROR"/>
- </logger>
- <logger name="org.hibernate">
- <level value="WARN"/>
- </logger>
-
- <!-- Display SQL requests and results by setting the following loggers to level DEBUG -->
- <logger name="org.hibernate.SQL">
- <level value="WARN"/>
- </logger>
- <logger name="org.apache.ibatis">
- <level value="WARN"/>
- </logger>
- <logger name="java.sql">
- <level value="WARN"/>
- </logger>
- <logger name="java.sql.ResultSet">
- <level value="WARN"/>
- </logger>
-
- <!-- Execution of measure filters -->
- <logger name="org.sonar.MEASURE_FILTER">
- <level value="WARN"/>
- </logger>
-
- <!-- Turn off ElasticSearch logging -->
- <logger name="org.elasticsearch">
- <level value="OFF"/>
- </logger>
- <logger name="org.elasticsearch.node">
- <level value="INFO"/>
- </logger>
- <logger name="org.elasticsearch.http">
- <level value="INFO"/>
- </logger>
- <!-- ElasticSearch profiling information -->
- <!--
- <logger name="org.sonar.server.search">
- <level value="DEBUG"/>
- </logger>
- -->
-
- <!-- Export of dry run database -->
- <!--
- <logger name="org.sonar.core.persistence.DbTemplate">
- <level value="DEBUG"/>
- </logger>
- <logger name="org.sonar.core.persistence.DryRunDatabaseFactory">
- <level value="DEBUG"/>
- </logger>
- -->
-
- <root>
- <level value="INFO"/>
- <appender-ref ref="LOGFILE"/>
- </root>
-
-</configuration>
diff --git a/sonar-application/src/main/java/org/sonar/application/Webapp.java b/sonar-application/src/main/java/org/sonar/application/Webapp.java
index c49bc73112a..a84e705fcaf 100644
--- a/sonar-application/src/main/java/org/sonar/application/Webapp.java
+++ b/sonar-application/src/main/java/org/sonar/application/Webapp.java
@@ -28,12 +28,14 @@ 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_VERBOSE = "sonar.log.verbose";
static void configure(Tomcat tomcat, Env env, Props props) {
String ctx = getContext(props);
try {
Context context = tomcat.addWebapp(ctx, env.file("web").getAbsolutePath());
context.setConfigFile(env.file("web/META-INF/context.xml").toURI().toURL());
+ context.addParameter(PROPERTY_LOG_VERBOSE, props.of(PROPERTY_LOG_VERBOSE, "false"));
configureRailsMode(props, context);
context.setJarScanner(new NullJarScanner());