Log cli arguments and vm arguments passed to indexer command
@@ -21,14 +21,18 @@ package org.apache.jackrabbit.oak.index;
import java.io.File;
import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
import java.nio.file.Path;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Calendar;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
+import com.google.common.base.Joiner;
import com.google.common.base.Stopwatch;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Sets;
@@ -88,6 +92,8 @@ public class IndexCommand implements Command {
setupDirectories(indexOpts);
setupLogging(indexOpts);
+ logCliArgs(args);
+
boolean success = false;
try {
if (indexOpts.isReindex() && opts.getCommonOpts().isReadWrite()) {
@@ -360,6 +366,13 @@ public class IndexCommand implements Command {
return ISO8601.format(Calendar.getInstance());
}
+ private static void logCliArgs(String[] args) {
+ log.info("Command line arguments used for indexing [{}]", Joiner.on(' ').join(args));
+ List<String> inputArgs = ManagementFactory.getRuntimeMXBean().getInputArguments();
+ if (!inputArgs.isEmpty()) {
+ log.info("System properties and vm options passed {}", inputArgs);
+ }
+ }
static Path getPath(File file) {
return file.toPath().normalize().toAbsolutePath();
