$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.200

Twitter updates

  • New ProcessWire “User Activity” module version released (v5), this post covers what's new— More
    12 August 2022
  • New post: Multi-language field translation export/import — In this post we cover the details of a new module that enables export and import capabilities for multi-language fields in ProcessWire… More
    5 August 2022
  • Weekly update, July 29: Continuing upgrades to ProcessWire’s comments system and FormBuilder, along with a working example—More
    29 July 2022

Latest news

  • ProcessWire Weekly #431
    In the 431st issue of ProcessWire Weekly we'll check out the weekly update from Ryan in which he covers a new version of a popular Pro module, share some recent tutorials and other online resources, and more. Read on!
    Weekly.pw / 13 August 2022
  • Multi-language field translation export/import
    In this post we cover the details of a new module that enables export and import capabilities for multi-language fields in ProcessWire.
    Blog / 5 August 2022
  • Subscribe to weekly ProcessWire news

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