/** * @inheritdoc */ public function init() { parent::init(); Event::on(BaseMailer::className(), BaseMailer::EVENT_AFTER_SEND, function ($event) { AuditMail::record($event); }); }
/** * @inheritdoc */ public function init() { parent::init(); $this->module->registerFunction('exception', function (Exception $e) { $entry = $this->module->getEntry(true); return $entry ? $this->log($entry->id, $e) : null; }); $this->module->registerFunction('errorMessage', function ($message, $code = 0, $file = '', $line = 0, $trace = []) { $entry = $this->module->getEntry(true); return $entry ? $this->logMessage($entry->id, $message, $code, $file, $line, $trace) : null; }); }