MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

LogProbe

MMO\admin\monitoring\probes · 1 symbol · generated 27 Oct 2026

class

LogProbe

LogProbe.php:20

The errors a target's logs gained since the last look: each log file is read from where the previous reading stopped (its size then), so an error is counted once, the collection it appeared in -- not at every collection while it is in the last lines. A file smaller than last time was rotated: it is read from its start.

class MMO\admin\monitoring\probes\LogProbe extends MMO\admin\monitoring\aProbe
Namespace
MMO\admin\monitoring\probes
Extends
aProbe
See
$files are globs on the target's server, {folder} being the target's folder and {name}, {database} and its vars what they are in deploy.json. A line is an error when it matches $errors, fatal when it also matches, $fatal (lowercase awk regexes: the line is lowercased first).
Metrics: `logs.newErrors`, `logs.newFatal`, `logs.sizeMb` (every file together), `logs.files`. Details: `files` (path, size, time: where the next reading starts), `lines` (the latest error lines, with their file).

Index

Constants5

DESCRIPTION

const DESCRIPTION = 'new errors and fatal errors in the logs'

KIND

const KIND = 'target'

NAME

const NAME = 'logs'

SAFE

what a glob may hold: nothing a shell would do anything with but expand * and ?

const SAFE = '/^[a-zA-Z0-9._\\/*?{}@+-]+$/'

SAFE_PATTERN

what a pattern may hold, for awk

const SAFE_PATTERN = '/^[a-z0-9 |()_.:\\[\\]-]+$/'

Properties5

errors

string $errors = 'error|exception|critical|uncaught|fatal'
Type
string

fatal

string $fatal = 'fatal|uncaught|critical|emergency'
Type
string

files

array $files = ['{folder}/shared/logs/*.log', '{folder}/shared/*.log']
Type
array

keep

int $keep = 30
Type
int

maxBytes

int $maxBytes = 4194304
Type
int

Methods4

globs($target)

LogProbe.php:51
function globs(MMO\admin\entities\Target $target): array
$targetTarget
returnsarraythe globs for $target, its placeholders resolved, every unsafe one left out

parse($output, $reading, $previous)

LogProbe.php:88
function parse( string $output, MMO\admin\monitoring\Reading $reading, ?MMO\admin\monitoring\Reading $previous = null ): void
$outputstringwhat script printed: per file, @@file, path size time, @@count errors fatal, its lines
$readingReadingfilled
$previous = nullnull | Readingits lines are kept below the new ones
returnsvoid

probe($subject, $reading, $previous)

LogProbe.php:45
protected function probe( MMO\admin\entities\Server|MMO\admin\entities\Target $subject, MMO\admin\monitoring\Reading $reading, ?MMO\admin\monitoring\Reading $previous ): void
$subjectServer | Target
$readingReading
$previousnull | Reading
returnsvoid

script($target, $previous)

LogProbe.php:61
function script( MMO\admin\entities\Target $target, ?MMO\admin\monitoring\Reading $previous = null ): string
$targetTarget
$previous = nullnull | Reading
returnsstring
Inherited members (16)
ConstantsDeclared byDescription
SERVERaProbea probe of servers
TARGETaProbea probe of targets: the sites of the project, one per client
PropertiesDeclared byDescription
enabledaProbe
hubaProbe
timeoutaProbe
MethodsDeclared byDescription
appliesTo($subject)aProbe
collect($subject, $previous, $time)aProbeLook at a subject, never throwing: whatever goes wrong is in the reading.
debugName()aProbe
failure($e)aProbe
needsShell()aProbe
Number($value)aProbe
Percent($part, $whole)aProbe
run($subject, $script)aProbeRun a script on the subject, stopped after $timeout seconds where timeout exists (a webspace may lack it).
Sections($output)aProbe
shell($subject)aProbe
__construct($options, $hub)aProbe