use of org.graylog2.featureflag.FeatureFlags in project graylog2-server by Graylog2.
the class CmdLineTool method run.
@Override
public void run() {
final Level logLevel = setupLogger();
if (isDumpDefaultConfig()) {
dumpDefaultConfigAndExit();
}
// This is holding all our metrics.
MetricRegistry metricRegistry = MetricRegistryFactory.create();
featureFlags = getFeatureFlags(metricRegistry);
installConfigRepositories();
installCommandConfig();
beforeStart();
beforeStart(parseAndGetTLSConfiguration(), parseAndGetPathConfiguration(configFile));
processConfiguration(jadConfig);
coreConfigInjector = setupCoreConfigInjector();
final Set<Plugin> plugins = loadPlugins(getPluginPath(configFile), chainingClassLoader);
installPluginConfig(plugins);
processConfiguration(jadConfig);
if (isDumpConfig()) {
dumpCurrentConfigAndExit();
}
if (!validateConfiguration()) {
LOG.error("Validating configuration file failed - exiting.");
System.exit(1);
}
final List<String> arguments = ManagementFactory.getRuntimeMXBean().getInputArguments();
LOG.info("Running with JVM arguments: {}", Joiner.on(' ').join(arguments));
beforeInjectorCreation(plugins);
injector = setupInjector(new NamedConfigParametersModule(jadConfig.getConfigurationBeans()), new PluginBindings(plugins), binder -> binder.bind(MetricRegistry.class).toInstance(metricRegistry));
if (injector == null) {
LOG.error("Injector could not be created, exiting! (Please include the previous error messages in bug " + "reports.)");
System.exit(1);
}
addInstrumentedAppender(metricRegistry, logLevel);
// Report metrics via JMX.
final JmxReporter reporter = JmxReporter.forRegistry(metricRegistry).build();
reporter.start();
startCommand();
}
Aggregations