Logger
class
Logger extends ExtendableObject
Simple way to log messages in global scope.
Usage:
Logger::log(Logger::NOTICE, 'Hey man!');
Constants
DEBUG
Detailed debug information.
DEPRECATED
Deprecated function usage.
INFO
Interesting events.
Examples: User logs in, SQL logs.
NOTICE
Uncommon events.
WARNING
Exceptional occurrences that are not errors.
Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.
ERROR
Runtime errors.
CRITICAL
Critical conditions.
Example: Application component unavailable, unexpected exception.
ALERT
Action must be taken immediately.
Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.
EMERGENCY
Urgent alert.
Properties
Methods
static
setTag(string $tag, string $value)
Set a logger tag.
static
resetTag(string $tag)
Reset a logger tag.
static
log($level, $message, string|object $module = '', array $context = [])
Send a message to the application log.
Inherited from ExtendableObject
__construct()
Constructor.
final static ExtendableObject
instance()
Get instance.
final static boolean
hasInstance()
Check whether there is an instance of this class available.
final boolean
extension($extension)
Call class method, if it exists.