public function bootstrap($app)
{
$this->logTarget = Yii::$app->getLog()->targets['debug'] = new LogTarget($this);
// delay attaching event handler to the view component after it is fully configured
$app->on(Application::EVENT_BEFORE_REQUEST, function () use($app) {
$app->getView()->on(View::EVENT_END_BODY, [$this, 'renderToolbar']);
$app->getResponse()->on(Response::EVENT_AFTER_PREPARE, [$this, 'setDebugHeaders']);
});
$app->getUrlManager()->addRules([['class' => 'yii\\web\\UrlRule', 'route' => $this->id, 'pattern' => $this->id], ['class' => 'yii\\web\\UrlRule', 'route' => $this->id . '/<controller>/<action>', 'pattern' => $this->id . '/<controller:[\\w\\-]+>/<action:[\\w\\-]+>']], false);
}