Core_Log_Default
extends Core_Log
in package
Log system. Default driver
Tags
Table of Contents
Properties
- $ERROR : int
- Backend property
- $MESSAGE : int
- Backend property
- $NOTICE : int
- Backend property
- $SUCCESS : int
- Backend property
- $WARNING : int
- Backend property
- $_locked : bool
- Log-file was locked
- $_logDir : string
- Logs directory
- $_login : string
- User login
- $_notify : bool
- E-mail notify mode
- $_site : string
- Name of the site
- $_status : int
- Status
- $_instance : array<string|int, mixed>
- The singleton instance.
Methods
- __construct() : mixed
- Constructor.
- clear() : self
- Clear object
- getLogName() : string
- Generate name of log from timestamp
- instance() : object
- Register an existing instance as a singleton.
- login() : self
- Set login
- notify() : self
- Set notify mode
- site() : self
- Set site name
- status() : self
- Set status
- write() : self
- Write message into log
- _deleteOldLogs() : self
- Delete old log files
- _getDriverName() : srting
- Get full driver name
Properties
$ERROR
Backend property
public
static int
$ERROR
= 4
$MESSAGE
Backend property
public
static int
$MESSAGE
= 0
$NOTICE
Backend property
public
static int
$NOTICE
= 2
$SUCCESS
Backend property
public
static int
$SUCCESS
= 1
$WARNING
Backend property
public
static int
$WARNING
= 3
$_locked
Log-file was locked
protected
static bool
$_locked
= \FALSE
$_logDir
Logs directory
protected
string
$_logDir
= \NULL
$_login
User login
protected
string
$_login
= \NULL
$_notify
E-mail notify mode
protected
bool
$_notify
= \TRUE
$_site
Name of the site
protected
string
$_site
= \NULL
$_status
Status
protected
int
$_status
= 0
$_instance
The singleton instance.
private
static array<string|int, mixed>
$_instance
= array()
Methods
__construct()
Constructor.
public
__construct() : mixed
clear()
Clear object
public
clear() : self
Return values
selfgetLogName()
Generate name of log from timestamp
public
getLogName(string $date) : string
Parameters
- $date : string
-
timestamp
Return values
stringinstance()
Register an existing instance as a singleton.
public
static instance([string $name = 'default' ]) : object
Parameters
- $name : string = 'default'
-
driver's name
Return values
objectlogin()
Set login
public
login(string $login) : self
Parameters
- $login : string
-
login
Return values
selfnotify()
Set notify mode
public
notify(int $notify) : self
Parameters
- $notify : int
-
mode
Return values
selfsite()
Set site name
public
site(string $site) : self
Parameters
- $site : string
-
name
Return values
selfstatus()
Set status
public
status(string $status) : self
Parameters
- $status : string
-
status
Return values
selfwrite()
Write message into log
public
write(string $message) : self
Parameters
- $message : string
-
message
Return values
self_deleteOldLogs()
Delete old log files
protected
_deleteOldLogs() : self
Return values
self_getDriverName()
Get full driver name
protected
static _getDriverName(string $driver) : srting
Parameters
- $driver : string
-
driver name