diff options
Diffstat (limited to 'server/sonar-db-dao/src')
11 files changed, 24 insertions, 24 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java index d24c4dac4b2..c4713e4c08f 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java @@ -24,15 +24,15 @@ import java.util.Objects; import java.util.function.Supplier; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.defaults.DefaultSqlSession; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static com.google.common.base.Preconditions.checkState; import static java.lang.String.format; import static java.lang.Thread.currentThread; public class DBSessionsImpl implements DBSessions { - private static final Logger LOG = Loggers.get(DBSessionsImpl.class); + private static final Logger LOG = LoggerFactory.getLogger(DBSessionsImpl.class); private static final ThreadLocal<Boolean> CACHING_ENABLED = ThreadLocal.withInitial(() -> Boolean.FALSE); private final ThreadLocal<DelegatingDbSessionSupplier> regularDbSession = ThreadLocal.withInitial(this::buildRegularDbSessionSupplier); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/property/InternalPropertiesDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/property/InternalPropertiesDao.java index 173f547fae6..388d1f77d34 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/property/InternalPropertiesDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/property/InternalPropertiesDao.java @@ -33,7 +33,7 @@ import java.util.stream.Collectors; import javax.annotation.CheckForNull; import javax.annotation.Nullable; import org.sonar.api.utils.System2; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.db.Dao; import org.sonar.db.DbSession; import org.sonar.db.audit.AuditPersister; @@ -188,7 +188,7 @@ public class InternalPropertiesDao implements Dao { } res = enforceSingleElement(key, mapper.selectAsClob(singletonList(key))); if (res == null) { - Loggers.get(InternalPropertiesDao.class) + LoggerFactory.getLogger(InternalPropertiesDao.class) .debug("Internal property {} has been found in db but has neither text value nor is empty. " + "Still it couldn't be retrieved with clob value. Ignoring the property.", key); return Optional.empty(); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java index b8524112225..e82d08d5885 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeDao.java @@ -29,8 +29,8 @@ import javax.annotation.Nullable; import org.sonar.api.utils.DateUtils; import org.sonar.api.utils.System2; import org.sonar.api.utils.TimeUtils; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.util.stream.MoreCollectors; import org.sonar.db.Dao; import org.sonar.db.DbSession; @@ -46,7 +46,7 @@ import static org.sonar.api.utils.DateUtils.dateToLong; import static org.sonar.db.DatabaseUtils.executeLargeInputs; public class PurgeDao implements Dao { - private static final Logger LOG = Loggers.get(PurgeDao.class); + private static final Logger LOG = LoggerFactory.getLogger(PurgeDao.class); private static final Set<String> QUALIFIERS_PROJECT_VIEW = Set.of("TRK", "VW"); private static final Set<String> QUALIFIER_SUBVIEW = Set.of("SVW"); private static final String SCOPE_PROJECT = "PRJ"; diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeProfiler.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeProfiler.java index d392fe30973..4eb9bc1d964 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeProfiler.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/PurgeProfiler.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.sonar.api.utils.TimeUtils; -import org.sonar.api.utils.log.Logger; +import org.slf4j.Logger; public class PurgeProfiler { diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java index 45b2d145431..27de822ddb9 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DefaultPeriodCleaner.java @@ -25,8 +25,8 @@ import java.util.List; import java.util.stream.Collectors; import org.sonar.api.config.Configuration; import org.sonar.api.utils.DateUtils; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.core.util.stream.MoreCollectors; import org.sonar.db.DbSession; import org.sonar.db.purge.PurgeDao; @@ -35,7 +35,7 @@ import org.sonar.db.purge.PurgeableAnalysisDto; public class DefaultPeriodCleaner { - private static final Logger LOG = Loggers.get(DefaultPeriodCleaner.class); + private static final Logger LOG = LoggerFactory.getLogger(DefaultPeriodCleaner.class); private final PurgeDao purgeDao; private final PurgeProfiler profiler; diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DeleteAllFilter.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DeleteAllFilter.java index 7f6697ecac1..d902d7f4d71 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DeleteAllFilter.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/DeleteAllFilter.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import org.sonar.api.utils.DateUtils; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.db.purge.PurgeableAnalysisDto; class DeleteAllFilter implements Filter { @@ -46,6 +46,6 @@ class DeleteAllFilter implements Filter { @Override public void log() { - Loggers.get(getClass()).debug("-> Delete data prior to: {}", DateUtils.formatDate(before)); + LoggerFactory.getLogger(getClass()).debug("-> Delete data prior to: {}", DateUtils.formatDate(before)); } } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepOneFilter.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepOneFilter.java index 336f21dd4ea..583271e9c8d 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepOneFilter.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepOneFilter.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import org.sonar.api.utils.DateUtils; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.db.purge.PurgeableAnalysisDto; class KeepOneFilter implements Filter { @@ -54,7 +54,7 @@ class KeepOneFilter implements Filter { @Override public void log() { - Loggers.get(getClass()).debug("-> Keep one snapshot per {} between {} and {}", label, DateUtils.formatDate(start), DateUtils.formatDate(end)); + LoggerFactory.getLogger(getClass()).debug("-> Keep one snapshot per {} between {} and {}", label, DateUtils.formatDate(start), DateUtils.formatDate(end)); } private static void appendSnapshotsToDelete(Interval interval, List<PurgeableAnalysisDto> toDelete) { diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepWithVersionFilter.java b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepWithVersionFilter.java index 6428c11ceb9..d67686ed4c7 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepWithVersionFilter.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/purge/period/KeepWithVersionFilter.java @@ -23,7 +23,7 @@ import com.google.common.base.Strings; import java.util.Date; import java.util.List; import org.sonar.api.utils.DateUtils; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.core.util.stream.MoreCollectors; import org.sonar.db.purge.PurgeableAnalysisDto; @@ -45,7 +45,7 @@ class KeepWithVersionFilter implements Filter { @Override public void log() { - Loggers.get(getClass()).debug("-> Keep analyses with a version prior to {}", DateUtils.formatDate(before)); + LoggerFactory.getLogger(getClass()).debug("-> Keep analyses with a version prior to {}", DateUtils.formatDate(before)); } private static boolean isDeletable(PurgeableAnalysisDto snapshot) { diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java b/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java index c83c5033e7b..69701ca7595 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/createdb/CreateDb.java @@ -26,8 +26,8 @@ import com.sonar.orchestrator.db.DefaultDatabase; import java.util.function.Consumer; import org.sonar.api.config.internal.MapSettings; import org.sonar.api.config.internal.Settings; -import org.sonar.api.utils.log.Logger; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.sonar.db.SQDatabase; public class CreateDb { @@ -60,7 +60,7 @@ public class CreateDb { } private static void logJdbcSettings(Settings settings) { - Logger logger = Loggers.get(CreateDb.class); + Logger logger = LoggerFactory.getLogger(CreateDb.class); for (String key : settings.getKeysStartingWith("sonar.jdbc")) { logger.info(key + ": " + settings.getString(key)); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeProfilerTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeProfilerTest.java index 756dfeb11e8..44aa4c7db59 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeProfilerTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/purge/PurgeProfilerTest.java @@ -21,7 +21,7 @@ package org.sonar.db.purge; import org.junit.Before; import org.junit.Test; -import org.sonar.api.utils.log.Logger; +import org.slf4j.Logger; import static org.mockito.ArgumentMatchers.contains; import static org.mockito.Mockito.mock; diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/SQDatabase.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/SQDatabase.java index 5740cc903fc..4a3485c6c06 100644 --- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/SQDatabase.java +++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/SQDatabase.java @@ -31,7 +31,7 @@ import org.sonar.api.config.internal.MapSettings; import org.sonar.api.config.internal.Settings; import org.sonar.api.utils.System2; import org.sonar.api.utils.Version; -import org.sonar.api.utils.log.Loggers; +import org.slf4j.LoggerFactory; import org.sonar.core.platform.Container; import org.sonar.core.platform.SonarQubeVersion; import org.sonar.core.platform.SpringComponentContainer; @@ -120,7 +120,7 @@ public class SQDatabase extends DefaultDatabase { } private void execute(RegisteredMigrationStep step, MigrationStep migrationStep) { - Profiler stepProfiler = Profiler.create(Loggers.get(SQDatabase.class)); + Profiler stepProfiler = Profiler.create(LoggerFactory.getLogger(SQDatabase.class)); stepProfiler.startInfo(STEP_START_PATTERN, step); boolean done = false; try { |