FileLog class

Creates and maintains a text-based log file.

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FileLog class also inherits all the methods and properties of: Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FileLog::chunkSize()
int

Get or set the default chunk size used when reading from logs and not overridden by method argument

 
FileLog::delete()
bool

Delete the log file

 
FileLog::filename()
string

Get file basename

 
FileLog::find()
int array

Return lines from the end of the log file, with various options

 
FileLog::get()
array

Get lines from the end of a file based on chunk size (deprecated)

 
FileLog::getDate(int $dateFrom)
array

Get log lines that lie within a date range

 
FileLog::getMaxLineLength()
None 
FileLog::getTotalLines()
int

Get total number of lines in the log file

 
FileLog::mtime()
int false

Get file modification time

 
FileLog::path()
string

Get path where the log is stored (with trailing slash)

 
FileLog::pathname()
string bool

Get file pathname

 
FileLog::prune($bytes)
bool int

Prune to number of bytes

 
FileLog::pruneBytes(int $bytes)
int bool

Prune log file to specified number of bytes (from the end)

 
FileLog::pruneDate($oldestDate)
int

Prune log file to contain only entries newer than $oldestDate

 
FileLog::save(string $str)
bool

Save the given log entry string

 
FileLog::setDelimeter($c)
None 
FileLog::setDelimiter($c)
None 
FileLog::setFileExtension($ext)
None 
FileLog::setMaxLineLength($c)
None 
FileLog::size()
int false

Get filesize

 
FileLog::wired()
None

Wired to API

 

Additional methods and properties

In addition to the methods and properties above, FileLog also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.253