dolibarr  13.0.2
Public Member Functions | Protected Member Functions | List of all members
DolLogsCollector Class Reference

DolLogsCollector class. More...

+ Inheritance diagram for DolLogsCollector:
+ Collaboration diagram for DolLogsCollector:

Public Member Functions

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

Protected Member Functions

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

Detailed Description

DolLogsCollector class.

Definition at line 11 of file DolLogsCollector.php.

Constructor & Destructor Documentation

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

Constructor.

Parameters
string$pathPath
string$nameName

Definition at line 28 of file DolLogsCollector.php.

References getLogsFile().

Member Function Documentation

DolLogsCollector::collect ( )

Return collected data.

Returns
array Array

Definition at line 71 of file DolLogsCollector.php.

References getLevels(), and getStorageLogs().

DolLogsCollector::getLevels ( )

Get the log levels from psr/log.

Returns
array Array of log level

Definition at line 199 of file DolLogsCollector.php.

Referenced by collect(), and getLogs().

DolLogsCollector::getLogs (   $file)

Search a string for log entries.

Parameters
string$fileFile
Returns
array Lines of logs

Definition at line 175 of file DolLogsCollector.php.

References getLevels().

Referenced by getStorageLogs().

DolLogsCollector::getLogsFile ( )

Get the path to the logs file.

Returns
string

Definition at line 105 of file DolLogsCollector.php.

Referenced by __construct().

DolLogsCollector::getStorageLogs (   $path)

Get logs.

Parameters
string$pathPath
Returns
array

Definition at line 118 of file DolLogsCollector.php.

References getLogs(), and tailFile().

Referenced by collect().

DolLogsCollector::getWidgets ( )

Return widget settings.

Returns
array Array

Definition at line 45 of file DolLogsCollector.php.

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

Get latest file lines.

Parameters
string$fileFile
int$linesLines
Returns
array Array

Definition at line 139 of file DolLogsCollector.php.

Referenced by getStorageLogs().


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