Logging messages with a stack of backends

category Zend
package Zend_Log

 Methods

Constructor

__construct() : \Zend\Log\Logger

todo support configuration (writers, dateTimeFormat, and writer plugin manager)

Returns

Shutdown all writers

__destruct() : void

Add a writer to a logger

addWriter(string | \Zend\Log\Writer\WriterInterface $writer, int $priority, array $options) : \Zend\Log\Logger

Parameters

$priority

int

$options

arraynull

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

alert()

alert(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

crit()

crit(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

debug()

debug(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

emerg()

emerg(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

err()

err(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

Get writer plugin manager

getWriterPluginManager() : \Zend\Log\WriterPluginManager

Get writers

getWriters() : \Zend\Stdlib\SplPriorityQueue

info()

info(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

Add a message as a log entry

log(int $priority, mixed $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$priority

int

$message

mixed

$extra

array\Traversable

Exceptions

\Zend\Log\Exception\InvalidArgumentException if message can't be cast to string
\Zend\Log\Exception\InvalidArgumentException if extra can't be iterated over
\Zend\Log\Exception\RuntimeException if no log writer specified

Returns

notice()

notice(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

Register logging system as an error handler to log PHP errors

registerErrorHandler(\Zend\Log\Logger $logger) : bool

Register logging system as an exception handler to log PHP exceptions

registerExceptionHandler(\Zend\Log\Logger $logger) : bool

Set writer plugin manager

setWriterPluginManager(string | \Zend\Log\WriterPluginManager $plugins) : \Zend\Log\Logger

Set the writers

setWriters(\Zend\Stdlib\SplPriorityQueue $writers) : \Zend\Log\Logger

Unregister error handler

unregisterErrorHandler() 

Unregister exception handler

unregisterExceptionHandler() 

warn()

warn(string $message, array | \Traversable $extra) : \Zend\Log\Logger

Parameters

$message

string

$extra

array\Traversable

Returns

Get writer instance

writerPlugin(string $name, array $options) : \Zend\Log\Writer\WriterInterface

Parameters

$name

string

$options

arraynull

Returns

 Properties

 

Map of PHP error constants to log priorities

$errorPriorityMap : array

 

List of priority code => priority (short) name

$priorities : array

 

Registered error handler

$registeredErrorHandler : bool

 

Registered exception handler

$registeredExceptionHandler : bool

 

Writer plugins

$writerPlugins : \Zend\Log\WriterPluginManager

 

Writers

$writers : \Zend\Stdlib\SplPriorityQueue

 Constants

 

ALERT

ALERT 

 

CRIT

CRIT 

 

DEBUG

DEBUG 

 

EMERG

EMERG 

const int defined from the BSD Syslog message severities
link http://tools.ietf.org/html/rfc3164
 

ERR

ERR 

 

INFO

INFO 

 

NOTICE

NOTICE 

 

WARN

WARN