Interface Psr\Log\LoggerInterface

Implemented byPsr\Log\AbstractLogger, Psr\Log\NullLogger, Symfony\Component\Console\Logger\ConsoleLogger

Describes a logger instance.

The message MUST be a string or object implementing __toString().

The message MAY contain placeholders in the form: {foo} where foo will be replaced by the context data in key "foo".

The context array can contain arbitrary data. The only assumption that can be made by implementors is that if an Exception instance is given to produce a stack trace, it MUST be in a key named "exception".

See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md for the full interface specification.

Public Methods

Hide inherited methods

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

Method Details

alert() public abstract method

Action must be taken immediately.

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

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

Critical conditions.

Example: Application component unavailable, unexpected exception.

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

Detailed debug information.

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

System is unusable.

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

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

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

Interesting events.

Example: User logs in, SQL logs.

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

Logs with an arbitrary level.

public abstract null log ( $level, $message, array $context = [] )
$level mixed
$message string
$context array
notice() public abstract method

Normal but significant events.

public abstract null notice ( $message, array $context = [] )
$message string
$context array
warning() public abstract 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 abstract null warning ( $message, array $context = [] )
$message string
$context array