From: Evgeny Mandrikov Date: Wed, 27 Apr 2011 19:23:24 +0000 (+0400) Subject: SONAR-2299 Show Hibernate SQL only if debug logging level enabled, but not info level X-Git-Tag: 2.8~107^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=09566e047c391ae32e49bc47f7584a231ee14553;p=sonarqube.git SONAR-2299 Show Hibernate SQL only if debug logging level enabled, but not info level --- diff --git a/sonar-application/src/main/assembly/conf/logback.xml b/sonar-application/src/main/assembly/conf/logback.xml index 47de61218c1..407cbdbe265 100644 --- a/sonar-application/src/main/assembly/conf/logback.xml +++ b/sonar-application/src/main/assembly/conf/logback.xml @@ -89,7 +89,7 @@ - + diff --git a/sonar-batch/src/main/resources/org/sonar/batch/logback.xml b/sonar-batch/src/main/resources/org/sonar/batch/logback.xml index cd79fb299d6..91b34037ace 100644 --- a/sonar-batch/src/main/resources/org/sonar/batch/logback.xml +++ b/sonar-batch/src/main/resources/org/sonar/batch/logback.xml @@ -12,7 +12,7 @@ - + diff --git a/sonar-core/src/main/java/org/sonar/jpa/session/AbstractDatabaseConnector.java b/sonar-core/src/main/java/org/sonar/jpa/session/AbstractDatabaseConnector.java index ba3e77928fa..e543fecc28f 100644 --- a/sonar-core/src/main/java/org/sonar/jpa/session/AbstractDatabaseConnector.java +++ b/sonar-core/src/main/java/org/sonar/jpa/session/AbstractDatabaseConnector.java @@ -71,6 +71,7 @@ public abstract class AbstractDatabaseConnector implements DatabaseConnector { public String getDialectId() { return dialect.getId(); } + /** * Indicates if the connector is operational : database connection OK and schema version OK */ @@ -158,12 +159,12 @@ public abstract class AbstractDatabaseConnector implements DatabaseConnector { props.put(Environment.DIALECT, getDialectClass()); props.put("hibernate.generate_statistics", getConfiguration().getBoolean(DatabaseProperties.PROP_HIBERNATE_GENERATE_STATISTICS, false)); - props.put("hibernate.show_sql", Boolean.valueOf(LOG_SQL.isInfoEnabled()).toString()); + props.put("hibernate.show_sql", Boolean.valueOf(LOG_SQL.isDebugEnabled()).toString()); Configuration subset = getConfiguration().subset("sonar.hibernate"); for (Iterator keys = subset.getKeys(); keys.hasNext();) { String key = (String) keys.next(); - if (StringUtils.isNotBlank((String)subset.getProperty(key))) { + if (StringUtils.isNotBlank((String) subset.getProperty(key))) { props.put("hibernate." + key, subset.getProperty(key)); } } @@ -171,7 +172,6 @@ public abstract class AbstractDatabaseConnector implements DatabaseConnector { // custom impl setup setupEntityManagerFactory(props); - return props; }