dolibarr 21.0.0-beta
mod_syslog_file Class Reference

Class to manage logging to a file. More...

Inheritance diagram for mod_syslog_file:
Collaboration diagram for mod_syslog_file:

Public Member Functions

 getName ()
 Return name of logger.
 
 getVersion ()
 Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')
 
 getInfo ()
 Content of the info tooltip.
 
 isActive ()
 Is the logger active ?
 
 configure ()
 Return array of configuration data.
 
 checkConfiguration ()
 Return if configuration is valid.
 
 export ($content, $suffixinfilename='')
 Export the message.
 
- Public Member Functions inherited from LogHandler
 getWarning ()
 Return warning if something is wrong with logger.
 
 setIdent ($ident)
 Set current ident.
 

Private Member Functions

 getFilename ($suffixinfilename='')
 Return the parsed logfile path.
 

Detailed Description

Class to manage logging to a file.

Definition at line 11 of file mod_syslog_file.php.

Member Function Documentation

◆ checkConfiguration()

mod_syslog_file::checkConfiguration ( )

Return if configuration is valid.

Returns
bool true if ok

Reimplemented from LogHandler.

Definition at line 90 of file mod_syslog_file.php.

References dol_syslog(), and getFilename().

◆ configure()

mod_syslog_file::configure ( )

Return array of configuration data.

Returns
array<array{name:string,constant:string,default:string,css?:string}> Return array of configuration data

Reimplemented from LogHandler.

Definition at line 71 of file mod_syslog_file.php.

◆ export()

mod_syslog_file::export ( $content,
$suffixinfilename = '' )

Export the message.

Parameters
array{level:int,ip:string,ospid:string,osuser:string,message:string}$content Array containing the info about the message
string$suffixinfilenameWhen output is a file, append this suffix into default log filename.
Returns
void @phan-suppress PhanPluginDuplicateArrayKey

Reimplemented from LogHandler.

Definition at line 166 of file mod_syslog_file.php.

References dol_now(), dol_print_date(), dol_trunc(), dolChmod(), getDolGlobalString(), and getFilename().

◆ getFilename()

mod_syslog_file::getFilename ( $suffixinfilename = '')
private

Return the parsed logfile path.

Parameters
string$suffixinfilenameWhen output is a file, append this suffix into default log filename.
Returns
string

Definition at line 111 of file mod_syslog_file.php.

References $conf, getDolGlobalInt(), getDolGlobalString(), and getUserRemoteIP().

Referenced by checkConfiguration(), and export().

◆ getInfo()

mod_syslog_file::getInfo ( )

Content of the info tooltip.

Returns
false|string

Reimplemented from LogHandler.

Definition at line 49 of file mod_syslog_file.php.

◆ getName()

mod_syslog_file::getName ( )

Return name of logger.

Returns
string Name of logger

Reimplemented from LogHandler.

Definition at line 27 of file mod_syslog_file.php.

◆ getVersion()

mod_syslog_file::getVersion ( )

Version of the module ('x.y.z' or 'dolibarr' or 'experimental' or 'development')

Returns
string

Reimplemented from LogHandler.

Definition at line 39 of file mod_syslog_file.php.

◆ isActive()

mod_syslog_file::isActive ( )

Is the logger active ?

Returns
int<0,1> If logger enabled

Reimplemented from LogHandler.

Definition at line 61 of file mod_syslog_file.php.

References getDolGlobalString().


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