From 09566e047c391ae32e49bc47f7584a231ee14553 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Wed, 27 Apr 2011 23:23:24 +0400 Subject: [PATCH] SONAR-2299 Show Hibernate SQL only if debug logging level enabled, but not info level --- sonar-application/src/main/assembly/conf/logback.xml | 2 +- sonar-batch/src/main/resources/org/sonar/batch/logback.xml | 2 +- .../org/sonar/jpa/session/AbstractDatabaseConnector.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) 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; } -- 2.39.5