public function init()
{
parent::init();
$app = Yii::$app;
// Before action triggers a new audit entry
$app->on(Application::EVENT_BEFORE_ACTION, [$this, 'onBeforeAction']);
// After request finalizes the audit entry.
$app->on(Application::EVENT_AFTER_REQUEST, [$this, 'onAfterRequest']);
// Activate the logging target
$this->logTarget = $app->getLog()->targets['audit'] = new LogTarget($this);
// Boot all active panels
$this->normalizePanelConfiguration();
$this->panels = $this->loadPanels(array_keys($this->panels));
}