Enables creation of logs, logging of events, and management of logs.
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the WireLog
class also inherits all the methods and properties of: Wire.
Common
Retrieval
Name | Return | Summary | |
---|---|---|---|
$log->getEntries() $log->getEntries(string $name) $log->getEntries(string $name, array $options = []) | array | Return given number of entries from end of log file, with each entry as an associative array of components | |
$log->getFilename() $log->getFilename(string $name) $log->getFilename(string $name) | string | Get the full filename (including path) for the given log name | |
$log->getLines() $log->getLines(string $name) $log->getLines(string $name, array $options = []) | array | Return the given number of entries from the end of log file | |
$log->getLogs() $log->getLogs() $log->getLogs(bool $sortNewest = false) | array | Return array of all logs, sorted by name | |
$log->getTotalEntries() $log->getTotalEntries(string $name) $log->getTotalEntries(string $name) | int | Get the total number of entries present in the given log |
Manipulation
Name | Return | Summary | |
---|---|---|---|
$log->delete() $log->delete(string $name) $log->delete(string $name) | bool | Delete a log file | |
$log->prune() $log->prune(string $name, int $days) $log->prune(string $name, int $days) | int | Prune log file to contain only entries from last [n] days |
Additional methods and properties
In addition to the methods and properties above, WireLog also inherits the methods and properties of these classes:
API reference based on ProcessWire core version 3.0.236