$log->getLines() method

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.236

Latest news

  • ProcessWire Weekly #514
    In the 514th issue of ProcessWire Weekly we'll check out the latest blog post from Ryan, introduce two new third party modules — Page List Versions Counter and Fieldtype Fieldset Panel — and more. Read on!
    Weekly.pw / 16 March 2024
  • Invoices Site Profile
    The new invoices site profile is a free invoicing application developed in ProcessWire. It enables you to create invoices, record payments to them, email invoices to clients, print invoices, and more. This post covers all the details.
    Blog / 15 March 2024
  • Subscribe to weekly ProcessWire news

I just love the easy and intuitive ProcessWire API. ProcessWire rocks!” —Jens Martsch, Web developer