dblog
in package
Class dblog
Tags
Table of Contents
Properties
- $logFile : string
Methods
- all() : array<string|int, mixed>|bool
- Retrieves all the log entries from the log file.
- clear() : bool
- count() : string
- parselines() : array<string|int, mixed>
- Parses the given log line and extracts relevant information.
- trimlines() : array<string|int, mixed>
- Trims the lines of the given file content and returns an array of trimmed lines. (see phplog class)
Properties
$logFile
protected
string
$logFile
= path . '/logs/main/dberror.log'
Methods
all()
Retrieves all the log entries from the log file.
public
all() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool —Returns an array of log entries if successful, otherwise returns false.
clear()
public
clear() : bool
Return values
boolcount()
public
count() : string
Return values
stringparselines()
Parses the given log line and extracts relevant information.
private
parselines(array<string|int, mixed> $line) : array<string|int, mixed>
Parameters
- $line : array<string|int, mixed>
-
An array containing the log line to be parsed.
Return values
array<string|int, mixed> —Returns an associative array containing the parsed log information. The array has the following structure: [ 'stamp' => int, // The timestamp of the log entry 'ip' => string, // The IP address associated with the log entry 'errlvl' => string, // The error level of the log entry 'mess' => string, // The message of the log entry 'stack' => string // The stack trace of the log entry ] If the input line is empty, the method returns false.
trimlines()
Trims the lines of the given file content and returns an array of trimmed lines. (see phplog class)
private
trimlines(array<string|int, mixed> $filecontent) : array<string|int, mixed>
Parameters
- $filecontent : array<string|int, mixed>
-
The content of the file to be trimmed.
Return values
array<string|int, mixed> —The trimmed lines of the file content.