summaryrefslogtreecommitdiffstats
path: root/server/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-07-31 22:48:49 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-07-31 22:49:00 +0200
commit6849b22ad9fb4227bdc2a3f210d7c9d041331885 (patch)
treeef4016def6803b5a86a9d817adf03e6b8fa56bdd /server/sonar-server
parent70127b482f581abbfd4066c980c304c9d7fb3c7b (diff)
downloadsonarqube-6849b22ad9fb4227bdc2a3f210d7c9d041331885.tar.gz
sonarqube-6849b22ad9fb4227bdc2a3f210d7c9d041331885.zip
SONAR-4898 fix some logs
Diffstat (limited to 'server/sonar-server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/app/Logging.java8
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java7
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java27
3 files changed, 19 insertions, 23 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/Logging.java b/server/sonar-server/src/main/java/org/sonar/server/app/Logging.java
index d2e1ed70e76..0610bcdd7ed 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/app/Logging.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/app/Logging.java
@@ -78,15 +78,11 @@ class Logging {
}
static void configure(Tomcat tomcat, Props props) {
- tomcat.setSilent(false);
- tomcat.getService().addLifecycleListener(new LifecycleLogger(console()));
+ tomcat.setSilent(true);
+ tomcat.getService().addLifecycleListener(new LifecycleLogger(LoggerFactory.getLogger(Logging.class)));
configureLogbackAccess(tomcat, props);
}
- static Logger console() {
- return LoggerFactory.getLogger("console");
- }
-
private static void configureLogbackAccess(Tomcat tomcat, Props props) {
if (props.booleanOf(PROPERTY_ENABLE_ACCESS_LOGS, true)) {
LogbackValve valve = new LogbackValve();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java b/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java
index 2371978637e..466c78b9664 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java
@@ -38,6 +38,13 @@ class Webapp {
String webDir = props.of("sonar.path.web");
LoggerFactory.getLogger(Webapp.class).info("Webapp directory: " + webDir);
StandardContext context = (StandardContext) tomcat.addWebapp(getContextPath(props), webDir);
+ context.setClearReferencesHttpClientKeepAliveThread(false);
+ context.setClearReferencesStatic(false);
+ context.setClearReferencesStopThreads(false);
+ context.setClearReferencesStopTimerThreads(false);
+ context.setClearReferencesStopTimerThreads(false);
+ context.setAntiResourceLocking(false);
+ context.setAntiJARLocking(false);
context.setReloadable(false);
context.setUseHttpOnly(true);
context.setProcessTlds(false);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java b/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
index 4213543b164..a6e28704afa 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/search/ESNode.java
@@ -63,8 +63,6 @@ public class ESNode implements Startable {
private Client client;
private Node node;
protected final Profiling profiling;
- private final Profiling.Level profilingLevel;
-
public ESNode(Settings settings) {
this(settings, DEFAULT_HEALTH_TIMEOUT);
@@ -75,8 +73,6 @@ public class ESNode implements Startable {
this.settings = settings;
this.healthTimeout = healthTimeout;
this.profiling = new Profiling(settings);
- String settingsValue = settings.getString(Profiling.CONFIG_PROFILING_LEVEL);
- this.profilingLevel = Profiling.Level.fromConfigString(settingsValue);
}
@Override
@@ -190,40 +186,40 @@ public class ESNode implements Startable {
esSettings
.put("index.mapper.dynamic", false)
- // Sortable text analyzer
+ // Sortable text analyzer
.put("index.analysis.analyzer.sortable.type", "custom")
.put("index.analysis.analyzer.sortable.tokenizer", "keyword")
.putArray("index.analysis.analyzer.sortable.filter", "trim", "lowercase", "truncate")
- // Edge NGram index-analyzer
+ // Edge NGram index-analyzer
.put("index.analysis.analyzer.index_grams.type", "custom")
.put("index.analysis.analyzer.index_grams.tokenizer", "whitespace")
.putArray("index.analysis.analyzer.index_grams.filter", "trim", "lowercase", "gram_filter")
- // Edge NGram search-analyzer
+ // Edge NGram search-analyzer
.put("index.analysis.analyzer.search_grams.type", "custom")
.put("index.analysis.analyzer.search_grams.tokenizer", "whitespace")
.putArray("index.analysis.analyzer.search_grams.filter", "trim", "lowercase")
- // Word index-analyzer
+ // Word index-analyzer
.put("index.analysis.analyzer.index_words.type", "custom")
.put("index.analysis.analyzer.index_words.tokenizer", "standard")
.putArray("index.analysis.analyzer.index_words.filter",
"standard", "word_filter", "lowercase", "stop", "asciifolding", "porter_stem")
- // Word search-analyzer
+ // Word search-analyzer
.put("index.analysis.analyzer.search_words.type", "custom")
.put("index.analysis.analyzer.search_words.tokenizer", "standard")
.putArray("index.analysis.analyzer.search_words.filter",
"standard", "lowercase", "stop", "asciifolding", "porter_stem")
- // Edge NGram filter
+ // Edge NGram filter
.put("index.analysis.filter.gram_filter.type", "edgeNGram")
.put("index.analysis.filter.gram_filter.min_gram", 2)
.put("index.analysis.filter.gram_filter.max_gram", 15)
.putArray("index.analysis.filter.gram_filter.token_chars", "letter", "digit", "punctuation", "symbol")
- // Word filter
+ // Word filter
.put("index.analysis.filter.word_filter.type", "word_delimiter")
.put("index.analysis.filter.word_filter.generate_word_parts", true)
.put("index.analysis.filter.word_filter.catenate_words", true)
@@ -234,7 +230,7 @@ public class ESNode implements Startable {
.put("index.analysis.filter.word_filter.split_on_numerics", true)
.put("index.analysis.filter.word_filter.stem_english_possessive", true)
- // Path Analyzer
+ // Path Analyzer
.put("index.analysis.analyzer.path_analyzer.type", "custom")
.put("index.analysis.analyzer.path_analyzer.tokenizer", "path_hierarchy");
@@ -291,10 +287,7 @@ public class ESNode implements Startable {
}
public <K extends ActionResponse> K execute(ActionRequestBuilder action) {
- StopWatch requestProfile = null;
- if (profilingLevel.ordinal() >= Profiling.Level.BASIC.ordinal()) {
- requestProfile = profiling.start("search", Profiling.Level.BASIC);
- }
+ StopWatch requestProfile = profiling.start("search", Profiling.Level.BASIC);
ListenableActionFuture acc = action.execute();
try {
K response = (K) acc.get();
@@ -303,7 +296,7 @@ public class ESNode implements Startable {
throw new IllegalStateException("ES error: ", e);
} finally {
if (requestProfile != null) {
- requestProfile.stop(action.toString());
+ requestProfile.stop("Requested: ", action);
}
}
}