PHP Class CI_Log, TastyIgniter

see https://github.com/stevethomas/codeigniter-monolog & https://github.com/Seldaek/monolog
Mostrar archivo Open project: tastyigniter/tastyigniter Class Usage Examples

Protected Properties

Property Type Description
$_date_fmt string Format of timestamp for log files
$_enabled boolean Whether or not the logger can write to the log files
$_file_ext string Filename extension
$_file_permissions integer File permissions
$_levels array Predefined logging levels
$_log_path string Path to save log files
$_threshold integer Level of logging
$_threshold_array array Array of threshold levels to log

Public Methods

Method Description
__construct ( ) : void Class constructor
write_log ( string $level, string $msg ) : boolean Write Log File

Protected Methods

Method Description
_format_line ( string $level, string $date, $message ) : string Format the log line.

Method Details

__construct() public method

Class constructor
public __construct ( ) : void
return void

_format_line() protected method

This is for extensibility of log formatting If you want to change the log format, extend the CI_Log class and override this method
protected _format_line ( string $level, string $date, $message ) : string
$level string The error level
$date string Formatted date string
return string Formatted log line with a new line character '\n' at the end

write_log() public method

Generally this function will be called using the global log_message() function
public write_log ( string $level, string $msg ) : boolean
$level string The error level: 'error', 'debug' or 'info'
$msg string The error message
return boolean

Property Details

$_date_fmt protected_oe property

Format of timestamp for log files
protected string $_date_fmt
return string

$_enabled protected_oe property

Whether or not the logger can write to the log files
protected bool $_enabled
return boolean

$_file_ext protected_oe property

Filename extension
protected string $_file_ext
return string

$_file_permissions protected_oe property

File permissions
protected int $_file_permissions
return integer

$_levels protected_oe property

Predefined logging levels
protected array $_levels
return array

$_log_path protected_oe property

Path to save log files
protected string $_log_path
return string

$_threshold protected_oe property

Level of logging
protected int $_threshold
return integer

$_threshold_array protected_oe property

Array of threshold levels to log
protected array $_threshold_array
return array