class Tlog implements LoggerInterface

Thelia Logger

Allow to define different level and output.

Constants

VAR_LEVEL

VAR_DESTINATIONS

VAR_PREFIXE

VAR_FILES

VAR_IP

VAR_SHOW_REDIRECT

DEBUG

INFO

NOTICE

WARNING

ERROR

CRITICAL

ALERT

EMERGENCY

MUET

DEFAULT_LEVEL

DEFAUT_DESTINATIONS

DEFAUT_PREFIXE

DEFAUT_FILES

DEFAUT_IP

DEFAUT_SHOW_REDIRECT

Properties

$dir_destinations

Methods

static  Tlog
getInstance()

No description

static  Tlog
getNewInstance()

Create a new Tlog instance, that could be configured without interfering with the "main" instance

setDestinations( string $destinations)

No description

array
getDestinationsDirectories()

Return the directories where destinations classes should be searched.

setLevel( int $level)

change the debug level. Use Tlog constant : \Thelia\Log\Tlog::DEBUG set level to Debug

setPrefix($prefix)

No description

setFiles($files)

No description

setIp($ips)

No description

setShowRedirect($bool)

No description

setConfig($destination, $param, $valeur)

No description

getConfig($destination, $param)

No description

null
debug( string $message, array $context = array())

Detailed debug information.

addDebug()

Alias of debug method. With this method you can put all parameter you want

null
info( string $message, array $context = array())

Interesting events.

addInfo()

Alias of info method. With this method you can put all parameter you want

null
notice( string $message, array $context = array())

Normal but significant events.

addNotice()

Alias of notice method. With this method you can put all parameter you want

null
warning( string $message, array $context = array())

Exceptional occurrences that are not errors.

addWarning()

Alias of warning method. With this method you can put all parameter you want

null
error( string $message, array $context = array())

Runtime errors that do not require immediate action but should typically be logged and monitored.

addError()

Alias of error method. With this method you can put all parameter you want

err($message, array $context = array())

No description

null
critical( string $message, array $context = array())

Critical conditions.

addCritical()

Alias of critical method. With this method you can put all parameter you want

crit($message, array $context = array())

No description

null
alert( string $message, array $context = array())

Action must be taken immediately.

addAlert()

Alias of alert method. With this method you can put all parameter you want

null
emergency( string $message, array $context = array())

System is unusable.

addEmergency()

Alias of emergency method. With this method you can put all parameter you want

null
log( mixed $level, string $message, array $context = array())

Logs with an arbitrary level.

void
write( string $res)

final end method. Write log for each destination handler

writeOnExit()

No description

showRedirect($url)

No description

boolean
isActivated( int $level)

check if level is activated and control if current file is activated

boolean
isActivedFile( string $file)

check if $file is in authorized files

Details

at line 104
static Tlog getInstance()

Return Value

Tlog

at line 123
static Tlog getNewInstance()

Create a new Tlog instance, that could be configured without interfering with the "main" instance

Return Value

Tlog a new Tlog instance.

at line 161
setDestinations( string $destinations)

Parameters

string $destinations

at line 179
array getDestinationsDirectories()

Return the directories where destinations classes should be searched.

Return Value

array of directories

at line 190
setLevel( int $level)

change the debug level. Use Tlog constant : \Thelia\Log\Tlog::DEBUG set level to Debug

Parameters

int $level

at line 197
setPrefix($prefix)

Parameters

$prefix

at line 204
setFiles($files)

Parameters

$files

at line 213
setIp($ips)

Parameters

$ips

at line 222
setShowRedirect($bool)

Parameters

$bool

at line 230
setConfig($destination, $param, $valeur)

Parameters

$destination
$param
$valeur

at line 240
getConfig($destination, $param)

Parameters

$destination
$param

at line 259
null debug( string $message, array $context = array())

Detailed debug information.

Parameters

string $message
array $context

Return Value

null

at line 271
addDebug()

Alias of debug method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addDebug($arg1, $arg2, $arg3);

at line 289
null info( string $message, array $context = array())

Interesting events.

Example: User logs in, SQL logs.

Parameters

string $message
array $context

Return Value

null

at line 301
addInfo()

Alias of info method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addInfo($arg1, $arg2, $arg3);

at line 317
null notice( string $message, array $context = array())

Normal but significant events.

Parameters

string $message
array $context

Return Value

null

at line 329
addNotice()

Alias of notice method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addNotice($arg1, $arg2, $arg3);

at line 348
null warning( string $message, array $context = array())

Exceptional occurrences that are not errors.

Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

Parameters

string $message
array $context

Return Value

null

at line 360
addWarning()

Alias of warning method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addWarning($arg1, $arg2, $arg3);

at line 377
null error( string $message, array $context = array())

Runtime errors that do not require immediate action but should typically be logged and monitored.

Parameters

string $message
array $context

Return Value

null

at line 389
addError()

Alias of error method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addError($arg1, $arg2, $arg3);

at line 402
err($message, array $context = array())

Parameters

$message
array $context

See also

error()

at line 416
null critical( string $message, array $context = array())

Critical conditions.

Example: Application component unavailable, unexpected exception.

Parameters

string $message
array $context

Return Value

null

at line 428
addCritical()

Alias of critical method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addCritical($arg1, $arg2, $arg3);

at line 441
crit($message, array $context = array())

Parameters

$message
array $context

See also

critical()

at line 456
null alert( string $message, array $context = array())

Action must be taken immediately.

Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.

Parameters

string $message
array $context

Return Value

null

at line 468
addAlert()

Alias of alert method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addAlert($arg1, $arg2, $arg3);

at line 484
null emergency( string $message, array $context = array())

System is unusable.

Parameters

string $message
array $context

Return Value

null

at line 496
addEmergency()

Alias of emergency method. With this method you can put all parameter you want

ex : Tlog::getInstance()->addEmergency($arg1, $arg2, $arg3);

at line 513
null log( mixed $level, string $message, array $context = array())

Logs with an arbitrary level.

Parameters

mixed $level
string $message
array $context

Return Value

null

at line 529
void write( string $res)

final end method. Write log for each destination handler

Parameters

string $res

Return Value

void

at line 546
writeOnExit()

See also

write()

at line 558
showRedirect($url)

Parameters

$url

at line 583
boolean isActivated( int $level)

check if level is activated and control if current file is activated

Parameters

int $level

Return Value

boolean

at line 605
boolean isActivedFile( string $file)

check if $file is in authorized files

Parameters

string $file

Return Value

boolean