dolibarr 19.0.3
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.
 
 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

Definition at line 98 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 224 of file DolLogsCollector.php.

Referenced by collect(), and getLogs().

◆ getLogs()

DolLogsCollector::getLogs ( $file)

Search a string for log entries.

Parameters
string$fileFile
Returns
array Lines of logs

Definition at line 200 of file DolLogsCollector.php.

References getLevels().

Referenced by getStorageLogs().

◆ getLogsFile()

DolLogsCollector::getLogsFile ( )

Get the path to the logs file.

Returns
string

Definition at line 130 of file DolLogsCollector.php.

Referenced by __construct().

◆ getStorageLogs()

DolLogsCollector::getStorageLogs ( $path)

Get logs.

Parameters
string$pathPath
Returns
void

Definition at line 143 of file DolLogsCollector.php.

References getLogs(), and tailFile().

Referenced by collect().

◆ getWidgets()

DolLogsCollector::getWidgets ( )

Return widget settings.

Returns
array Array

Definition at line 72 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 164 of file DolLogsCollector.php.

Referenced by getStorageLogs().


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