Logger class abstract
Framework\Log\Logger
Class Logger.
Defined in libraries/log/src/Logger.php
Properties #
- $destination
- Logs destination.
- $config
- -
- $level
- Active log level.
- $lastLog
- -
- $debugCollector
- -
$destination
Logs destination.
$config
$level
Active log level.
$lastLog
$debugCollector
Methods #
- __construct()
- Logger constructor.
- getDestination()
- -
- getLastLog()
- Get the last accepted log in the current instance.
- getLevel()
- -
- log()
- Logs with an arbitrary level.
- logAlert()
- Level 6: Action must be taken immediately.
- logCritical()
- Level 5: Critical conditions.
- logDebug()
- Level 0: Detailed debug information.
- logEmergency()
- Level 7: System is unusable.
- logError()
- Level 4: Runtime errors that do not require immediate action but should typically be logged and monitored.
- logInfo()
- Level 1: Interesting events.
- logNotice()
- Level 2: Normal but significant events.
- logWarning()
- Level 3: Exceptional occurrences that are not errors.
- setDebugCollector()
- -
- setLevel()
- -
- getConfig()
- -
- makeId()
- -
- replaceContext()
- -
- setConfig()
- -
- setDestination()
- -
- write()
- -
__construct()
Logger constructor.
- string $destination
- \Framework\Log\LogLevel|int $level
- array $config
getDestination()
getLastLog()
Get the last accepted log in the current instance.
getLevel()
log()
Logs with an arbitrary level.
- \Framework\Log\LogLevel|int $level
- string $message
- array $context
logAlert()
Level 6: Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should
trigger the SMS alerts and wake you up.
- string $message
- array $context
logCritical()
Level 5: Critical conditions.
Example: Application component unavailable, unexpected exception.
- string $message
- array $context
logDebug()
Level 0: Detailed debug information.
- string $message
- array $context
logEmergency()
Level 7: System is unusable.
- string $message
- array $context
logError()
Level 4: Runtime errors that do not require immediate action but should typically be logged and monitored.
- string $message
- array $context
logInfo()
Level 1: Interesting events.
Example: User logs in, SQL logs.
- string $message
- array $context
logNotice()
Level 2: Normal but significant events.
- string $message
- array $context
logWarning()
Level 3: Exceptional occurrences that are not errors.
Example: Use of deprecated APIs, poor use of an API, undesirable things
that are not necessarily wrong.
- string $message
- array $context
setDebugCollector()
- \Framework\Log\Debug\LogCollector $debugCollector
setLevel()
- \Framework\Log\LogLevel|int $level
getConfig()
makeId()
replaceContext()
- string $message
- array $context
setConfig()
- array $config
setDestination()
- string $destination
write()
- \Framework\Log\Log $log