<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="nelmio_js_logger.logger.class">Nelmio\JsLoggerBundle\Logger</parameter>
        <parameter key="nelmio_js_logger.twig_extension.class">Nelmio\JsLoggerBundle\TwigExtension</parameter>
    </parameters>

    <services>
        <service id="nelmio_js_logger.logger" class="%nelmio_js_logger.logger.class%">
            <argument type="service" id="logger" />
            <argument>%nelmio_js_logger.allowed_levels%</argument>
            <argument>%nelmio_js_logger.ignore_messages%</argument>
            <argument>%nelmio_js_logger.ignore_url_prefixes%</argument>
            <tag name="monolog.logger" channel="frontend" />
        </service>

        <service id="nelmio_js_logger.twig_extension" class="%nelmio_js_logger.twig_extension.class%">
            <argument type="service" id="router" />
            <argument>%nelmio_js_logger.stacktrace_js_path%</argument>
            <tag name="twig.extension" />
        </service>
    </services>
</container>

<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="nelmio_js_logger.logger.class">Nelmio\JsLoggerBundle\Logger</parameter>
        <parameter key="nelmio_js_logger.twig_extension.class">Nelmio\JsLoggerBundle\TwigExtension</parameter>
    </parameters>

    <services>
        <service id="nelmio_js_logger.logger" class="%nelmio_js_logger.logger.class%" public="true">
            <argument type="service" id="logger" />
            <argument>%nelmio_js_logger.allowed_levels%</argument>
            <argument>%nelmio_js_logger.ignore_messages%</argument>
            <argument>%nelmio_js_logger.ignore_url_prefixes%</argument>
            <tag name="monolog.logger" channel="frontend" />
        </service>

        <service id="nelmio_js_logger.twig_extension" class="%nelmio_js_logger.twig_extension.class%">
            <argument type="service" id="router" />
            <argument>%nelmio_js_logger.stacktrace_js_path%</argument>
            <tag name="twig.extension" />
        </service>
    </services>
</container>

Mark the logger service as public explicitly
Mark the logger service as public explicitly

The controller access this service dynamically, so it requires the service to be public. Symfony 3.4 makes services private by default.