code: public function export()
      {
          foreach ($this->messages as $message) {
              list($msg, $level, $catagory, $timestamp, $traces) = $message;
  
              $errStr = '';
              $options = [
                  'level' => yii\log\Logger::getLevelName($level),
                  'extra' => [],
              ];
              $templateData = null;
              if (is_array($msg)) {
                  $errStr = isset($msg['msg']) ? $msg['msg'] : '';
                  if (isset($msg['data']))
                      $options['extra'] = $msg['data']; 
              } else {
                  $errStr = $msg;
              }
  
              // Store debug trace in extra data
              $traces = array_map(
                  function($v) {
                      return "{$v['file']}".PHP_EOL."{$v['class']}::{$v['function']} [{$v['line']}]";
                  },
                  $traces
              );
              if (!empty($traces))
                  $options['extra']['traces'] = $traces;
  
              $this->client->captureMessage(
                  $errStr,
                  array(),
                  $options,
                  false
              );
          }
      }
docs: Stores log messages to sentry.