Constants

EMERGENCY

EMERGENCY

Constants for log levels

ALERT

ALERT

CRITICAL

CRITICAL

ERROR

ERROR

WARNING

WARNING

NOTICE

NOTICE

INFO

INFO

DEBUG

DEBUG

Properties

$levels

$levels : array

Message level short codes

Type

array

$writers

$writers : array

Log writers

Type

array

$timestampFormat

$timestampFormat : string

Log timestamp format

Type

string

Methods

__construct()

__construct(\Pop\Log\Writer\WriterInterface  $writer = null, string  $timestampFormat = 'Y-m-d H:i:s') 

Constructor

Instantiate the logger object

Parameters

\Pop\Log\Writer\WriterInterface $writer
string $timestampFormat

addWriters()

addWriters(array  $writers) : \Pop\Log\Logger

Add log writers

Parameters

array $writers

Returns

\Pop\Log\Logger

getWriters()

getWriters() : array

Get all log writers

Returns

array

setTimestampFormat()

setTimestampFormat(string  $format = 'Y-m-d H:i:s') : \Pop\Log\Logger

Set timestamp format

Parameters

string $format

Returns

\Pop\Log\Logger

getTimestampFormat()

getTimestampFormat() : string

Get timestamp format

Returns

string

getLevel()

getLevel(integer  $level) : string

Get level

Parameters

integer $level

Returns

string

emergency()

emergency(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add an EMERGENCY log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

alert()

alert(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add an ALERT log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

critical()

critical(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add a CRITICAL log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

error()

error(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add an ERROR log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

warning()

warning(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add a WARNING log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

notice()

notice(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add a NOTICE log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

info()

info(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add an INFO log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

debug()

debug(mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add a DEBUG log entry

Parameters

mixed $message
array $context

Returns

\Pop\Log\Logger

log()

log(mixed  $level, mixed  $message, array  $context = array()) : \Pop\Log\Logger

Add a log entry

Parameters

mixed $level
mixed $message
array $context

Returns

\Pop\Log\Logger