// Report metrics via JMX.
final JmxReporter reporter = JmxReporter.forRegistry(metrics).build();
reporter.start();
InstrumentedAppender logMetrics = new InstrumentedAppender(metrics);
logMetrics.activateOptions();
org.apache.log4j.Logger.getRootLogger().setLevel(logLevel);
org.apache.log4j.Logger.getLogger(Main.class.getPackage().getName()).setLevel(logLevel);
org.apache.log4j.Logger.getRootLogger().addAppender(logMetrics);
SLF4JBridgeHandler.removeHandlersForRootLogger();