apachelog
in package
Class apachelog
Tags
Table of Contents
Properties
- $logFile : string
Methods
- all() : array<string|int, mixed>|bool
- clear() : bool
- Clears the contents of the log file.
- count() : string
- parseline() : array<string|int, mixed>|bool
- parselogtime() : int
- Parses a log time string and returns a Unix timestamp.
Properties
$logFile
protected
string
$logFile
= path . '/logs/dev-access.log'
Methods
all()
public
all() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|boolclear()
Clears the contents of the log file.
public
clear() : bool
This method opens the log file in write mode and truncates its contents, effectively clearing the file. If the file can be successfully opened and closed, the method returns true. Otherwise, it returns false.
Tags
Return values
bool —Returns true if the log file is successfully cleared, false otherwise.
count()
public
count() : string
Return values
stringparseline()
private
parseline(string $line) : array<string|int, mixed>|bool
Parameters
- $line : string
Return values
array<string|int, mixed>|boolparselogtime()
Parses a log time string and returns a Unix timestamp.
private
parselogtime(string $dt) : int
Parameters
- $dt : string
-
The log time string in the format "D/MMM/YYYY:HH:MM:SS +/-HHMM".
Return values
int —The Unix timestamp corresponding to the provided log time.