Servicio que parsea el fichero de log seleccionado
@param string|null $selectedLog

@return array
12765
public function formatLogFile($selectedLog)
    {
        $monthOpen = null;
        $files = new Finder();
        $files->files()->in(LOG_DIR)->name($selectedLog);
        $file = $match = null;
        $log = array();
        foreach($files as $item) {
            $file = $item;
            $match = $item;
            break;
        }
        /** @var \SplFileInfo $file */
        if (null !== $file) {
            $time = date('c', $file->getMTime());
            $dateTime = new \DateTime($time);
            $monthOpen = $dateTime->format('m');
            $content = file($file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename());
            krsort($content);
            $detailLog = array();
            foreach ($content as &$line) {
                list($line, $detail) = $this->parseLogLine($line, $match);
                $detailLog[] = array_merge([
                    'log' => $line,
                ], $detail);
                if (count($detailLog) >= 1000) {
                    break;
                }
            }
            unset($line);
            $log = $detailLog;
        }
        return [$log, $monthOpen];
    }
866044
public function getLoginLogs()
    {
        /* @var $this User */
        $class = $this->loginLogClass;
        try {
            return $class::getLatests($this, Login::GET_ALL_LATESTS);
        } catch (\Exception $ex) {
            Yii::error($ex->getMessage(), __METHOD__);
            return [];
        }
    }
537250
public function readLog(): array
    {
        $logPath = $this->getLogPath();

        if (!file_exists($logPath)) {
            return [];
        }

        $data = @unserialize(file_get_contents($logPath));

        if (false === $data) {
            throw new \RuntimeException('Could not unserialize log file '.$logPath);
        }

        return (array) $data;
    }
693971
protected function get_legacy_logdata() {
        $chapter = $this->get_record_snapshot('book_chapters', $this->objectid);
        return array($this->courseid, 'book', 'update', 'view.php?id='.$this->contextinstanceid, $chapter->bookid, $this->contextinstanceid);
    }
758719
public function specEnd($log = null)
    {
        switch ($log->type()) {
            case 'passed':
                $this->_write($this->_symbols['dot']);
                break;
            case 'skipped':
                $this->_write('S', 'light-grey');
                break;
            case 'pending':
                $this->_write('P', 'cyan');
                break;
            case 'excluded':
                $this->_write('X', 'yellow');
                break;
            case 'failed':
                $this->_write('F', 'red');
                break;
            case 'errored':
                $this->_write('E', 'magenta');
                break;
        }
    }
5787
public function log()
	{
		$mode      = $this->output->getMode();
		$length    = ($this->arguments->getOpt('length')) ? (int)$this->arguments->getOpt('length') : 20;
		$start     = ($this->arguments->getOpt('start')) ? (int)$this->arguments->getOpt('start') : null;
		$upcoming  = $this->arguments->getOpt('include-upcoming');
		$installed = ($this->arguments->getOpt('exclude-installed')) ? false : true;
		$search    = ($this->arguments->getOpt('search')) ? $this->arguments->getOpt('search') : null;
		$format    = '%an: %s';
		$count     = $this->arguments->getOpt('count');

		if ($mode == 'minimal')
		{
			$format = '%H||%an||%ae||%ad||%s';
		}

		$logs = $this->mechanism->log($length, $start, $upcoming, $installed, $search, $format, $count);

		if ($count)
		{
			$this->output->addLine($logs);
			return;
		}

		if ($mode != 'minimal')
		{
			$output = array();
			foreach ($logs as $log)
			{
				$output[] = array('message'=>$log);
			}

			$this->output->addLinesFromArray($output);
		}
		else
		{
			if (is_array($logs) && count($logs) > 0)
			{
				foreach ($logs as $log)
				{
					$entry = array();
					$parts = explode('||', $log);
					$entry[$parts[0]] = array(
						'name'    => $parts[1],
						'email'   => $parts[2],
						'date'    => $parts[3],
						'subject' => $parts[4]
					);

					$this->output->addLine($entry);
				}
			}
		}
	}
804352
public function showLogView()
    {
        $this->subMenu['log']['active'] = true;

        $log = Log::getLogger();

        $logContents = '';

        collect($log->getHandlers())->reject(function ($handler) {
            return $handler instanceof SyslogHandler;
        })->each(function ($handler) use (&$logContents, $log) {
            if (file_exists($path = $log->getHandlers()[0]->getUrl())) {
                $logContents = file_get_contents($path);
            }
        });

        return View::make('dashboard.settings.log')->withLog($logContents)->withSubMenu($this->subMenu);
    }
925311
function collect() {
		foreach ( $this->_logs as &$log ) {
			if (!is_string($log['message'])) {
				$formated = $this->formatVars($log['message']);
				if ( $formated['exception'] ) {
					$log['label'] = '[ERROR]';
				}
				$log['message'] = $formated[0];
			}
		}
		return array(
			'messages'=>$this->_logs,
			'count'=>count($this->_logs),
		);
	}
775624
public function showClearedActivityLog()
    {
        if (config('LaravelLogger.loggerPaginationEnabled')) {
            $activities = Activity::onlyTrashed()
                ->orderBy('created_at', 'desc')
                ->paginate(config('LaravelLogger.loggerPaginationPerPage'));
            $totalActivities = $activities->total();
        } else {
            $activities = Activity::onlyTrashed()
                ->orderBy('created_at', 'desc')
                ->get();
            $totalActivities = $activities->count();
        }

        self::mapAdditionalDetails($activities);

        $data = [
            'activities'        => $activities,
            'totalActivities'   => $totalActivities,
        ];

        return View('LaravelLogger::logger.activity-log-cleared', $data);
    }
551055
protected function get_legacy_logdata() {
        global $CFG;
        $service = $this->get_record_snapshot('external_services', $this->objectid);
        return array(SITEID, 'webservice', 'add', $CFG->wwwroot . "/" . $CFG->admin . "/settings.php?section=externalservices",
            get_string('addservice', 'webservice', $service));
    }
209905
public function FormatContent($Log) {
      $Data = $Log['Data'];

      // TODO: Check for a custom log type handler.

      switch ($Log['RecordType']) {
         case 'Activity':
            $Result = $this->FormatKey('Story', $Data);
            break;
         case 'Discussion':
            $Result =
               '<b>'.$this->FormatKey('Name', $Data).'</b><br />'.
               $this->FormatKey('Body', $Data);
            break;
         case 'ActivityComment':
         case 'Comment':
            $Result = $this->FormatKey('Body', $Data);
            break;
         case 'Configuration':
            $Result = $this->FormatConfiguration($Data);
            break;
         case 'Registration':
         case 'User':
            $Result = $this->FormatRecord(array('Email', 'Name'), $Data);
            if ($DiscoveryText = GetValue('DiscoveryText', $Data)) {
               $Result .= '<br /><b>'.T('Why do you want to join?').'</b><br />'.Gdn_Format::Display($DiscoveryText);
            }
            if (GetValue('Banned', $Data)) {
               $Result .= "<br />".T('Banned');
            }
            break;
         default:
            $Result = '';
      }
      return $Result;
   }
537976
public function getLog($index = null)
    {
        if (is_null($index)) {
            return $this->log;
        }

        return $this->log[$index];
    }
1093318
protected function get_legacy_logdata() {
        if ($this->other['itemtype'] === 'course') {
            $url = 'tag/search.php?query=' . urlencode($this->other['tagrawname']);
            return array($this->courseid, 'coursetags', 'add', $url, 'Course tagged');
        }

        return null;
    }
671530
public function parse()
	{
		if (is_array($this->record->context))
			$this->record->formatted = str_replace("{log-context}", print_r($this->record->context, 1), $this->record->formatted);

		return $this->record;
	}
856724
public function parse()
	{
		if (is_bool($this->record->context))
		{
			$ctx = $this->record->context? "TRUE" : "FALSE";
			$this->record->formatted = str_replace("{log-context}", $ctx, $this->record->formatted);
			return $this->record;
		}
		else
		{
			return $this->record;
		}
	}
237101
protected function get_legacy_logdata() {
        return array($this->courseid, 'scorm', 'userreportinteractions', 'report/userreportinteractions.php?id=' .
                $this->contextinstanceid . '&user=' . $this->relateduserid . '&attempt=' . $this->other['attemptid'],
                $this->other['instanceid'], $this->contextinstanceid);
    }
37881
protected function get_legacy_logdata() {
        $legacylogdata = array($this->courseid,
            'choice',
            'choose',
            'view.php?id=' . $this->contextinstanceid,
            $this->other['choiceid'],
            $this->contextinstanceid);

        return $legacylogdata;
    }