Migrate server classes to Flogger
This is the second part of the migration to Flogger. This change migrates all classes of the 'server' module to Flogger. Classes of the 'httpd' module have been migrated by the predecessor change. Other modules continue to use slf4j. They should be migrated by follow-up changes. During this migration we try to make the log statements more consistent: - avoid string concatenation - avoid usage of String.format(...) Change-Id: I233afc8360af7fef8640394204d0d676cc0d0001 Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package com.google.gerrit.server.git;
|
||||
|
||||
import com.google.common.flogger.backend.Platform;
|
||||
import com.google.gerrit.extensions.events.LifecycleListener;
|
||||
import com.google.gerrit.server.config.GerritServerConfig;
|
||||
import com.google.gerrit.server.config.SitePaths;
|
||||
@@ -40,13 +41,17 @@ public class GarbageCollectionLogFile implements LifecycleListener {
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
LogManager.getLogger(GarbageCollection.class).removeAllAppenders();
|
||||
LogManager.getLogger(GarbageCollectionRunner.class).removeAllAppenders();
|
||||
getLogger(GarbageCollection.class).removeAllAppenders();
|
||||
getLogger(GarbageCollectionRunner.class).removeAllAppenders();
|
||||
}
|
||||
|
||||
private static void initLogSystem(Path logdir, boolean rotate) {
|
||||
initGcLogger(logdir, rotate, LogManager.getLogger(GarbageCollection.class));
|
||||
initGcLogger(logdir, rotate, LogManager.getLogger(GarbageCollectionRunner.class));
|
||||
initGcLogger(logdir, rotate, getLogger(GarbageCollection.class));
|
||||
initGcLogger(logdir, rotate, getLogger(GarbageCollectionRunner.class));
|
||||
}
|
||||
|
||||
private static Logger getLogger(Class<?> clazz) {
|
||||
return LogManager.getLogger(Platform.getBackend(clazz.getName()).getLoggerName());
|
||||
}
|
||||
|
||||
private static void initGcLogger(Path logdir, boolean rotate, Logger gcLogger) {
|
||||
|
Reference in New Issue
Block a user