Documentation

apachelog
in package

Class apachelog

Tags
author

Lutz Boldt boldt@bitstore-online.de

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>|bool

clear()

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
throws
Exception

If an error occurs while opening or closing the log file.

Return values
bool

Returns true if the log file is successfully cleared, false otherwise.

count()

public count() : string
Return values
string

parseline()

private parseline(string $line) : array<string|int, mixed>|bool
Parameters
$line : string
Return values
array<string|int, mixed>|bool

parselogtime()

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.


        
On this page

Search results