Merge branch 'stable-2.11'
* stable-2.11: Disable gc_log file for in-memory acceptance tests Remove logs folder creation from GarbageCollectionLogFile Change-Id: I99086cc2d1de52fd8e0fd0de1f9b828625d6090b
This commit is contained in:
@@ -28,6 +28,7 @@ import com.google.gerrit.server.git.SubmoduleOp;
|
|||||||
import com.google.gerrit.server.index.ChangeSchemas;
|
import com.google.gerrit.server.index.ChangeSchemas;
|
||||||
import com.google.gerrit.server.ssh.NoSshModule;
|
import com.google.gerrit.server.ssh.NoSshModule;
|
||||||
import com.google.gerrit.server.util.SocketUtil;
|
import com.google.gerrit.server.util.SocketUtil;
|
||||||
|
import com.google.gerrit.server.util.SystemLog;
|
||||||
import com.google.gerrit.testutil.FakeEmailSender;
|
import com.google.gerrit.testutil.FakeEmailSender;
|
||||||
import com.google.gerrit.testutil.TempFileUtil;
|
import com.google.gerrit.testutil.TempFileUtil;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
@@ -123,6 +124,9 @@ public class GerritServer {
|
|||||||
if (desc.memory()) {
|
if (desc.memory()) {
|
||||||
site = null;
|
site = null;
|
||||||
mergeTestConfig(cfg);
|
mergeTestConfig(cfg);
|
||||||
|
// Set the log4j configuration to an invalid one to prevent system logs
|
||||||
|
// from getting configured and creating log files.
|
||||||
|
System.setProperty(SystemLog.LOG4J_CONFIGURATION, "invalidConfiguration");
|
||||||
cfg.setBoolean("httpd", null, "requestLog", false);
|
cfg.setBoolean("httpd", null, "requestLog", false);
|
||||||
cfg.setBoolean("sshd", null, "requestLog", false);
|
cfg.setBoolean("sshd", null, "requestLog", false);
|
||||||
cfg.setBoolean("index", "lucene", "testInmemory", true);
|
cfg.setBoolean("index", "lucene", "testInmemory", true);
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.git;
|
package com.google.gerrit.server.git;
|
||||||
|
|
||||||
import com.google.gerrit.common.FileUtil;
|
|
||||||
import com.google.gerrit.extensions.events.LifecycleListener;
|
import com.google.gerrit.extensions.events.LifecycleListener;
|
||||||
import com.google.gerrit.server.config.SitePaths;
|
import com.google.gerrit.server.config.SitePaths;
|
||||||
import com.google.gerrit.server.util.SystemLog;
|
import com.google.gerrit.server.util.SystemLog;
|
||||||
@@ -30,10 +29,8 @@ public class GarbageCollectionLogFile implements LifecycleListener {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public GarbageCollectionLogFile(SitePaths sitePaths) {
|
public GarbageCollectionLogFile(SitePaths sitePaths) {
|
||||||
Path logdir = FileUtil.mkdirsOrDie(sitePaths.logs_dir,
|
|
||||||
"Cannot create log directory");
|
|
||||||
if (SystemLog.shouldConfigure()) {
|
if (SystemLog.shouldConfigure()) {
|
||||||
initLogSystem(logdir);
|
initLogSystem(sitePaths.logs_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,11 @@ import java.nio.file.Path;
|
|||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class SystemLog {
|
public class SystemLog {
|
||||||
|
private static final org.slf4j.Logger log =
|
||||||
|
LoggerFactory.getLogger(SystemLog.class);
|
||||||
|
|
||||||
|
public static final String LOG4J_CONFIGURATION = "log4j.configuration";
|
||||||
|
|
||||||
private static final org.slf4j.Logger log = LoggerFactory
|
|
||||||
.getLogger(SystemLog.class);
|
|
||||||
private static final String LOG4J_CONFIGURATION = "log4j.configuration";
|
|
||||||
private final SitePaths site;
|
private final SitePaths site;
|
||||||
private final Config config;
|
private final Config config;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user