Logging messages with a stack of backends

 Methods

Constructor

__construct(array | \Traversable $options) : \Zend\Log\Logger

Set options for an logger. Accepted options are: - writers: array of writers to add to this logger - exceptionhandler: if true register this logger as exceptionhandler - errorhandler: if true register this logger as errorhandler

Parameters

$options

array\Traversable

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

Shutdown all writers

__destruct() : void

Add a processor to a logger

addProcessor(string | \Zend\Log\Processor\ProcessorInterface $processor, int $priority, array $options) : \Zend\Log\Logger

Parameters

$priority

int

$options

arraynull

Exceptions

\Zend\Log\Exception\InvalidArgumentException

Returns

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 processor plugin manager

getProcessorPluginManager() : \Zend\Log\ProcessorPluginManager

Get processors

getProcessors() : \Zend\Stdlib\SplPriorityQueue

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

Get processor instance

processorPlugin(string $name, array $options) : \Zend\Log\Processor\ProcessorInterface

Parameters

$name

string

$options

arraynull

Returns

Register logging system as an error handler to log PHP errors

registerErrorHandler(\Zend\Log\Logger $logger, bool $continueNativeHandler) : mixed

link http://www.php.net/manual/function.set-error-handler.php

Parameters

$continueNativeHandler

bool

Exceptions

\Zend\Log\Exception\InvalidArgumentException if logger is null

Returns

mixedReturns result of set_error_handler

Register logging system as an exception handler to log PHP exceptions

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

Set processor plugin manager

setProcessorPluginManager(string | \Zend\Log\ProcessorPluginManager $plugins) : \Zend\Log\Logger

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 native PHP errors to priority

$errorPriorityMap : array

 

List of priority code => priority (short) name

$priorities : array

 

Processor plugins

$processorPlugins : \Zend\Log\ProcessorPluginManager

 

Processors

$processors : \Zend\Stdlib\SplPriorityQueue

 

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