Abstract Class Psr\Log\AbstractLogger

InheritancePsr\Log\AbstractLogger
ImplementsPsr\Log\LoggerInterface
SubclassesPsr\Log\NullLogger, Symfony\Component\Console\Logger\ConsoleLogger

This is a simple Logger implementation that other Loggers can inherit from.

It simply delegates all log-level-specific methods to the log method to reduce boilerplate code that a simple Logger that does the same thing with messages regardless of the error level has to implement.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
alert() Action must be taken immediately. Psr\Log\AbstractLogger
critical() Critical conditions. Psr\Log\AbstractLogger
debug() Detailed debug information. Psr\Log\AbstractLogger
emergency() System is unusable. Psr\Log\AbstractLogger
error() Runtime errors that do not require immediate action but should typically be logged and monitored. Psr\Log\AbstractLogger
info() Interesting events. Psr\Log\AbstractLogger
log() Logs with an arbitrary level. Psr\Log\LoggerInterface
notice() Normal but significant events. Psr\Log\AbstractLogger
warning() Exceptional occurrences that are not errors. Psr\Log\AbstractLogger

Method Details

alert() public method

Action must be taken immediately.

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

public null alert ( $message, array $context = [] )
$message string
$context array
critical() public method

Critical conditions.

Example: Application component unavailable, unexpected exception.

public null critical ( $message, array $context = [] )
$message string
$context array
debug() public method

Detailed debug information.

public null debug ( $message, array $context = [] )
$message string
$context array
emergency() public method

System is unusable.

public null emergency ( $message, array $context = [] )
$message string
$context array
error() public method

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

public null error ( $message, array $context = [] )
$message string
$context array
info() public method

Interesting events.

Example: User logs in, SQL logs.

public null info ( $message, array $context = [] )
$message string
$context array
notice() public method

Normal but significant events.

public null notice ( $message, array $context = [] )
$message string
$context array
warning() public method

Exceptional occurrences that are not errors.

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

public null warning ( $message, array $context = [] )
$message string
$context array