class Logger extends AbstractLogger (View source)

Constants

private ISO8601_DATETIME_FORMAT

private LEVELS

private DEFAULT_LEVEL

Methods

static array
levelNames()

Level names accepted by the logging.level setting, most severe first.

__construct(LogHandlerInterface $handler, string $logLevel)

No description

void
log($level, Stringable|string $message, array $context = [])

No description

static string
interpolatePlaceholders(string $message, array $context)

Substitute PSR-3 {key} placeholders in a log message with values from the context array.

Details

static array levelNames()

Level names accepted by the logging.level setting, most severe first.

Return Value

array

__construct(LogHandlerInterface $handler, string $logLevel)

No description

Parameters

LogHandlerInterface $handler
string $logLevel

void log($level, Stringable|string $message, array $context = [])

No description

Parameters

$level
Stringable|string $message
array $context

Return Value

void

static string interpolatePlaceholders(string $message, array $context)

Substitute PSR-3 {key} placeholders in a log message with values from the context array.

Shared by Logger and the lightweight PhpErrorLogPsrLogger fallback so the substitution rules stay in one place.

Parameters

string $message
array $context

Return Value

string