private void configureLogger(final Optional<String> logLevel, final URL configurationResource) throws LogbackException {
        /*
         * LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
         */
        final ILoggerFactory context = LoggerFactory.getILoggerFactory();
        if (!context.getClass().isAssignableFrom(this.LoggerContext_class)) {
            throw new ClassCastException(
                    "LoggerFactory.getILoggerFactory() did not return logback's ch.qos.logback.classic.LoggerContext.");
        }

        /*
         * JoranConfigurator configurator = new JoranConfigurator();
         * configurator.setContext(context);
         * context.reset();
         */
        final Object configuratorObject;
        try {
            configuratorObject = this.constructJoranConfigurator.newInstance();
            this.setContext.invoke(configuratorObject, context);
            this.reset.invoke(context);
        } catch (final ReflectiveOperationException ex) {
            throw new LogbackException(ex);
        }

        /*
         * try {
         *     configurator.doConfigure(getClass().getResource(name));
         * } catch (JoranException ex) {
         *     throw new RuntimeException(ex);
         * }
         */
        try {
            this.doConfigure.invoke(configuratorObject, configurationResource);
        } catch (final ReflectiveOperationException ex) {
            if (ex instanceof InvocationTargetException) {
                final Throwable targetException = ((InvocationTargetException) ex).getTargetException();
                if (this.JoranException_class.isAssignableFrom(targetException.getClass())) {
                    throw new RuntimeException(targetException);
                }
            }
            throw new LogbackException(ex);
        }

        final Logger logger = getRootLogger();

        /*
         * if (logger instanceof Logger) {
         *     ((Logger) logger).setLevel(Level.toLevel(level.toUpperCase(), Level.DEBUG));
         * }
         */
        if (this.Logger_class.isAssignableFrom(logger.getClass())) {
            try {
                this.setLevel.invoke(logger, this.chooseLevel(logLevel));
            } catch (final ReflectiveOperationException ex) {
                throw new LogbackException(ex);
            }
        }

    }
Configures Logback's root logger.

<p>It calls Logback's configurators through reflection so that embulk-core does not need to depend on Logback's classes.
embulk-core/src/main/java/org/embulk/cli/CliLogbackConfigurator.java