dolibarr 20.0.0
DolLogsCollector Class Reference

DolLogsCollector class. More...

Inheritance diagram for DolLogsCollector:
Collaboration diagram for DolLogsCollector:

Public Member Functions

 __construct ($path=null, $name='logs')
 Constructor.
 
 getWidgets ()
 Return widget settings.
 
 collect ()
 Return collected data.
 
 getLogsFile ()
 Get the path to the logs file.
 
 getStorageLogs ($path)
 Get logs.
 
 getLogs ($file)
 Search a string for log entries into the log file.
 
 getLevels ()
 Get the log levels from psr/log.
 

Protected Member Functions

 tailFile ($file, $lines)
 Get latest file lines.
 

Detailed Description

DolLogsCollector class.

Definition at line 33 of file DolLogsCollector.php.

Constructor & Destructor Documentation

◆ __construct()

DolLogsCollector::__construct ( $path = null,
$name = 'logs' )

Constructor.

Parameters
string$pathPath
string$nameName

Definition at line 55 of file DolLogsCollector.php.

References getDolGlobalInt(), and getLogsFile().

Member Function Documentation

◆ collect()

DolLogsCollector::collect ( )

Return collected data.

Returns
array Array of collected data

Definition at line 96 of file DolLogsCollector.php.

References getDolGlobalInt(), getLevels(), and getStorageLogs().

◆ getLevels()

DolLogsCollector::getLevels ( )

Get the log levels from psr/log.

Returns
array Array of log level

Definition at line 223 of file DolLogsCollector.php.

Referenced by collect(), and getLogs().

◆ getLogs()

DolLogsCollector::getLogs ( $file)

Search a string for log entries into the log file.

Used when debug bar scan log file (very slow).

Parameters
string$fileFile
Returns
array Lines of logs

Definition at line 198 of file DolLogsCollector.php.

References getLevels().

Referenced by getStorageLogs().

◆ getLogsFile()

DolLogsCollector::getLogsFile ( )

Get the path to the logs file.

Returns
string

Definition at line 128 of file DolLogsCollector.php.

Referenced by __construct().

◆ getStorageLogs()

DolLogsCollector::getStorageLogs ( $path)

Get logs.

Parameters
string$pathPath
Returns
void

Definition at line 141 of file DolLogsCollector.php.

References getLogs(), and tailFile().

Referenced by collect().

◆ getWidgets()

DolLogsCollector::getWidgets ( )

Return widget settings.

Returns
array Array

Definition at line 70 of file DolLogsCollector.php.

◆ tailFile()

DolLogsCollector::tailFile ( $file,
$lines )
protected

Get latest file lines.

Parameters
string$fileFile
int$linesLines
Returns
array Array

Definition at line 162 of file DolLogsCollector.php.

Referenced by getStorageLogs().


The documentation for this class was generated from the following file: