EventLog

Model for logging system errors and debug trace messages

 class System\Models\EventLog
extends Model

Properties

protected $jsonable : array

List of attribute names which are json encoded and decoded from the database.

protected $table : string

The database table used by the model.

Methods

public static add (string $message, string $level = "info", string $details = null) : self

Creates a log record

Parameters
Property Description
$message
string

Specifies the message text

$level
string

Specifies the logging level

$details
string

Specifies the error details string

Returns
self

public getLevelAttribute (string $level) : string

Beautify level value.

Parameters
Property Description
$level
string
Returns
string

public getSummaryAttribute () : string

Creates a shorter version of the message attribute, extracts the exception message or limits by 100 characters.

Returns
string

public static useLogging () : bool

Returns true if this logger should be used.

Returns
bool
Copyright © 2024 Winter CMS