Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     Event::on(BaseMailer::className(), BaseMailer::EVENT_AFTER_SEND, function ($event) {
         AuditMail::record($event);
     });
 }
Exemplo n.º 2
0
 /**
  * @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;
     });
 }