diff options
Diffstat (limited to 'sonar-application/src/main/assembly/conf/logback.xml')
-rw-r--r-- | sonar-application/src/main/assembly/conf/logback.xml | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/sonar-application/src/main/assembly/conf/logback.xml b/sonar-application/src/main/assembly/conf/logback.xml new file mode 100644 index 00000000000..551ae9806b5 --- /dev/null +++ b/sonar-application/src/main/assembly/conf/logback.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<configuration debug="false"> + + <!-- appender used when deploying Sonar WAR on a JEE server --> + <appender name="SONAR_WAR" class="ch.qos.logback.core.ConsoleAppender"> + <!-- avoid to log 404 file not found messages from the rails file servlet --> + <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> + <evaluator name="mavenRepoFileNotFound"> + <expression>message.startsWith("files: File not found: /maven")</expression> + </evaluator> + <OnMismatch>NEUTRAL</OnMismatch> + <OnMatch>DENY</OnMatch> + </filter> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern> + %d{yyyy.MM.dd HH:mm:ss} %-5level %logger{20} %X %msg%n + </pattern> + </layout> + </appender> + + <!-- appender used when using sonar with the provided jetty web container --> + <appender name="SONAR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <File>../../logs/sonar.log</File> + <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <param name="FileNamePattern" value="../../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> + <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> + <evaluator name="mavenRepoFileNotFound"> + <expression>message.startsWith("files: File not found: /maven")</expression> + </evaluator> + <OnMismatch>NEUTRAL</OnMismatch> + <OnMatch>DENY</OnMatch> + </filter> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern> + %d{yyyy.MM.dd HH:mm:ss} %-5level %logger{20} %X %msg%n + </pattern> + </layout> + </appender> + + <!-- appender used to profile Sonar Web Server --> + <appender name="PROFILING_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <File>../../logs/profiling.log</File> + <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <param name="FileNamePattern" value="../../logs/profiling.%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> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern> + %d{yyyy.MM.dd HH:mm:ss} %-5level %logger{20} %X %msg%n + </pattern> + </layout> + </appender> + + <!-- + Profiling of JRuby on Rails requests . Uncomment in order to log HTTP and SQL requests. + Execute the following command to get the HTTP requests with execution time > 10s : + grep 'rails Completed in [0-9]\{5,\}ms' < profiling.log + --> + <!-- + <logger name="rails" additivity="false"> + <level value="DEBUG"/> + <appender-ref ref="PROFILING_FILE"/> + </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.cache.EhCacheProvider"> + <!-- removing "org.hibernate.cache.EhCacheProvider - Could not find configuration)" message --> + <level value="ERROR"/> + </logger> + + <!-- set INFO to activate Hibernate SQL logs. NOT RECOMMENDED --> + <logger name="org.hibernate.SQL"> + <level value="ERROR"/> + </logger> + + <!-- set INFO to activate Hibernate SQL statistics. NOT RECOMMENDED --> + <logger name="org.sonar.DBSTATISTICS"> + <level value="ERROR"/> + </logger> + + <logger name="org.sonar.INFO"> + <level value="INFO"/> + </logger> + + <root> + <level value="WARN"/> + <appender-ref ref="SONAR_FILE"/> + </root> + +</configuration>
\ No newline at end of file |