log
extends AbstractLogger
in package
Table of Contents
Constants
- DEFAULT_MAX_LINE = 200
Properties
- $_log_name : mixed
- $config : mixed
- $level : mixed
Methods
- __construct() : mixed
- add() : mixed
- Add message and keep it less than 1000 lines
- authorizeClearLog() : mixed
- Check authorisation to emptying log file
- chunk() : mixed
- chunkLog() : mixed
- clear() : mixed
- Empty log file
- clearAll() : mixed
- convertLogLevel() : mixed
- define_error_reporting() : mixed
- Set php error level
- exception() : mixed
- get() : bool|array<string|int, mixed>
- Get $_nbLines from a $_log from $_begin position
- getConfig() : mixed
- getDelta() : array<string|int, mixed>
- Get the log delta from $_position to the end of the file New position is stored in $_position when eof is reached
- getLastLine() : string
- Efficiently get the last line of a file
- getLogger() : mixed
- getLogLevel() : mixed
- getPathToLog() : mixed
- liste() : mixed
- log() : mixed
- remove() : mixed
- Delete log file
- removeAll() : mixed
Constants
DEFAULT_MAX_LINE
public
mixed
DEFAULT_MAX_LINE
= 200
Properties
$_log_name
private
mixed
$_log_name
$config
private
static mixed
$config
= \null
$level
private
static mixed
$level
= array('debug' => 100, 'info' => 200, 'notice' => 250, 'warning' => 300, 'error' => 400, 'critical' => 500, 'alert' => 550, 'emergency' => 600)
Methods
__construct()
public
__construct(mixed $log_name) : mixed
Parameters
- $log_name : mixed
add()
Add message and keep it less than 1000 lines
public
static add(mixed $_log, string $_type, string $_message[, mixed $_logicalId = '' ]) : mixed
Parameters
- $_log : mixed
- $_type : string
-
message type (info, debug, warning, danger)
- $_message : string
-
message added into log
- $_logicalId : mixed = ''
authorizeClearLog()
Check authorisation to emptying log file
public
static authorizeClearLog(mixed $_log[, mixed $_subPath = '' ]) : mixed
Parameters
- $_log : mixed
- $_subPath : mixed = ''
chunk()
public
static chunk([mixed $_log = '' ]) : mixed
Parameters
- $_log : mixed = ''
chunkLog()
public
static chunkLog(mixed $_path) : mixed
Parameters
- $_path : mixed
clear()
Empty log file
public
static clear(mixed $_log) : mixed
Parameters
- $_log : mixed
clearAll()
public
static clearAll() : mixed
convertLogLevel()
public
static convertLogLevel([mixed $_level = 100 ]) : mixed
Parameters
- $_level : mixed = 100
define_error_reporting()
Set php error level
public
static define_error_reporting(int $log_level) : mixed
Parameters
- $log_level : int
Tags
exception()
public
static exception(mixed $e) : mixed
Parameters
- $e : mixed
get()
Get $_nbLines from a $_log from $_begin position
public
static get(string $_log, int $_begin, int $_nbLines) : bool|array<string|int, mixed>
Parameters
- $_log : string
- $_begin : int
- $_nbLines : int
Tags
Return values
bool|array<string|int, mixed>getConfig()
public
static getConfig(mixed $_key[, mixed $_default = '' ]) : mixed
Parameters
- $_key : mixed
- $_default : mixed = ''
getDelta()
Get the log delta from $_position to the end of the file New position is stored in $_position when eof is reached
public
static getDelta([string $_log = 'core' ][, int $_position = 0 ][, string $_search = '' ][, int $_colored = false ][, bool $_numbered = true ][, int $_numStart = 0 ][, int $_max = -1 ]) : array<string|int, mixed>
Parameters
- $_log : string = 'core'
-
Log filename (default 'core')
- $_position : int = 0
-
Bytes representing position from the begining of the file (default 0)
- $_search : string = ''
-
Text to find in log file (default '')
- $_colored : int = false
-
Should lines be colored (default false)
- $_numbered : bool = true
-
Should lines be numbered (default true)
- $_numStart : int = 0
-
At what number should lines number start (default 0)
- $_max : int = -1
-
Max number of returned lines (default is config value "maxLineLog")
Return values
array<string|int, mixed> —Array containing log to append to buffer and new position for next call
getLastLine()
Efficiently get the last line of a file
public
static getLastLine(string $_log) : string
Parameters
- $_log : string
-
Log filename
Return values
string —The last non-empty line of the file (or '')
getLogger()
public
static getLogger(mixed $_logName) : mixed
Parameters
- $_logName : mixed
getLogLevel()
public
static getLogLevel(mixed $_log) : mixed
Parameters
- $_log : mixed
getPathToLog()
public
static getPathToLog([mixed $_log = 'core' ]) : mixed
Parameters
- $_log : mixed = 'core'
liste()
public
static liste([mixed $_filtre = null ]) : mixed
Parameters
- $_filtre : mixed = null
log()
public
log(mixed $level, mixed $message[, array<string|int, mixed> $context = array() ]) : mixed
Parameters
- $level : mixed
- $message : mixed
- $context : array<string|int, mixed> = array()
remove()
Delete log file
public
static remove(mixed $_log) : mixed
Parameters
- $_log : mixed
removeAll()
public
static removeAll() : mixed