Documentation

ConsoleLogger extends AbstractLogger
in package

PSR-3 compliant console logger.

Tags
author

Kévin Dunglas dunglas@gmail.com

see
http://www.php-fig.org/psr/psr-3/

Table of Contents

Constants

ERROR  = 'error'
INFO  = 'info'

Properties

$errored  : mixed
$formatLevelMap  : array<string|int, mixed>
$output  : OutputInterface
$verbosityLevelMap  : array<string|int, mixed>

Methods

__construct()  : mixed
alert()  : void
Action must be taken immediately.
critical()  : void
Critical conditions.
debug()  : void
Detailed debug information.
emergency()  : void
System is unusable.
error()  : void
Runtime errors that do not require immediate action but should typically be logged and monitored.
hasErrored()  : mixed
Returns true when any messages have been logged at error levels.
info()  : void
Interesting events.
log()  : void
Logs with an arbitrary level.
notice()  : void
Normal but significant events.
warning()  : void
Exceptional occurrences that are not errors.
interpolate()  : string
Interpolates context values into the message placeholders.

Constants

Properties

$formatLevelMap

private array<string|int, mixed> $formatLevelMap = array(\Psr\Log\LogLevel::EMERGENCY => self::ERROR, \Psr\Log\LogLevel::ALERT => self::ERROR, \Psr\Log\LogLevel::CRITICAL => self::ERROR, \Psr\Log\LogLevel::ERROR => self::ERROR, \Psr\Log\LogLevel::WARNING => self::INFO, \Psr\Log\LogLevel::NOTICE => self::INFO, \Psr\Log\LogLevel::INFO => self::INFO, \Psr\Log\LogLevel::DEBUG => self::INFO)

$verbosityLevelMap

private array<string|int, mixed> $verbosityLevelMap = array(\Psr\Log\LogLevel::EMERGENCY => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::ALERT => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::CRITICAL => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::ERROR => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::WARNING => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_NORMAL, \Psr\Log\LogLevel::NOTICE => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERBOSE, \Psr\Log\LogLevel::INFO => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_VERY_VERBOSE, \Psr\Log\LogLevel::DEBUG => \Symfony\Component\Console\Output\OutputInterface::VERBOSITY_DEBUG)

Methods

__construct()

public __construct(OutputInterface $output[, array<string|int, mixed> $verbosityLevelMap = array() ][, array<string|int, mixed> $formatLevelMap = array() ]) : mixed
Parameters
$output : OutputInterface
$verbosityLevelMap : array<string|int, mixed> = array()
$formatLevelMap : array<string|int, mixed> = array()

alert()

Action must be taken immediately.

public alert(string $message[, array<string|int, mixed> $context = array() ]) : void

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

Parameters
$message : string
$context : array<string|int, mixed> = array()

critical()

Critical conditions.

public critical(string $message[, array<string|int, mixed> $context = array() ]) : void

Example: Application component unavailable, unexpected exception.

Parameters
$message : string
$context : array<string|int, mixed> = array()

debug()

Detailed debug information.

public debug(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

emergency()

System is unusable.

public emergency(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

error()

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

public error(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

hasErrored()

Returns true when any messages have been logged at error levels.

public hasErrored() : mixed

info()

Interesting events.

public info(string $message[, array<string|int, mixed> $context = array() ]) : void

Example: User logs in, SQL logs.

Parameters
$message : string
$context : array<string|int, mixed> = array()

log()

Logs with an arbitrary level.

public log(mixed $level, mixed $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$level : mixed
$message : mixed
$context : array<string|int, mixed> = array()

notice()

Normal but significant events.

public notice(string $message[, array<string|int, mixed> $context = array() ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = array()

warning()

Exceptional occurrences that are not errors.

public warning(string $message[, array<string|int, mixed> $context = array() ]) : void

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

Parameters
$message : string
$context : array<string|int, mixed> = array()

interpolate()

Interpolates context values into the message placeholders.

private interpolate(string $message, array<string|int, mixed> $context) : string
Parameters
$message : string
$context : array<string|int, mixed>
Tags
author

PHP Framework Interoperability Group

Return values
string

        
On this page

Search results