How to enable the debugger when using Yii1 and Yii2 together?

I’m updating my application built on Yii1, so I’m using Yii1 and Yii2 together. I can get the debugger to show when I’m using just Yii1, but when I’m combining Yii1 and Yii2, the debugger won’t show.

This is my entry point (index.php):

header('X-UA-Compatible: IE=edge,chrome=1');


    // include the customized Yii class
    require __DIR__ . '/../yii2/framework/Yii.php';

    switch (@$_SERVER["HTTP_HOST"]) {
        case "dev.jd":
            defined('YII_DEBUG') or define('YII_DEBUG', true);
            defined('YII_ENV') or define('YII_ENV', 'dev');
            //defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
            $config = dirname(__FILE__) . '/../protected/config/dev-jd.php';

            break;

        case "demo":
            $config = dirname(__FILE__).'/../protected/config/demo.php';
            break;
    }

    // configuration for Yii 2 application
    $yii2Config = require __DIR__ . '/../yii2/config/web.php';
    new yii\web\Application($yii2Config); // Do NOT call run(), yii2 app is only used as service locator

    $yii = require __DIR__ . '/../protected/config/main.php';
    Yii::createWebApplication($yii)->run();

This is my config file (dev-jd.php):

<?php

    return [
        'bootstrap' => ['debug'],
        'modules' => [
            'debug' => 'yii\debug\Module',
            'allowedIPs' => ['*']
        ]
    ];

And this is part of my web.php:

'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'allowedIPs' => ['*']
                ],
            ],
        ],

Can anyone see what I missing here?