$loggetLines()

Return the given number of entries from the end of log file

This method is pagination aware.

Usage

// basic usage
$array = $log->getLines(string $name);

// usage with all arguments
$array = $log->getLines(string $name, array $options = []);

Arguments

NameType(s)Description
$namestring

Name of log

$options (optional)array

Specify any of the following:

  • limit (integer): Specify number of lines Default:100
  • text (string): Text to find.
  • dateFrom (int|string): Oldest date to match entries.
  • dateTo (int|string): Newest date to match entries.
  • reverse (bool): Reverse order Default:true
  • pageNum (int): Pagination number 1 or above Default:0 which means auto-detect

Return value

array

See Also


$log methods and properties

API reference based on ProcessWire core version 3.0.251