1128. Class

1128.1. Zend\Log\Logger

Logging messages with a stack of backends

1128.1.1. Methods

1128.1.1.1. __construct

__construct()

Constructor

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:array|Traversable
Return type:Logger
Throws :ExceptionInvalidArgumentException

1128.1.1.2. __destruct

__destruct()

Shutdown all writers

Return type:void

1128.1.1.3. getWriterPluginManager

getWriterPluginManager()

Get writer plugin manager

Return type:WriterPluginManager

1128.1.1.4. setWriterPluginManager

setWriterPluginManager()

Set writer plugin manager

Parameters:string|WriterPluginManager
Return type:Logger
Throws :ExceptionInvalidArgumentException

1128.1.1.5. writerPlugin

writerPlugin()

Get writer instance

Parameters:
  • string
  • array|null
Return type:

WriterWriterInterface

1128.1.1.6. addWriter

addWriter()

Add a writer to a logger

Parameters:
  • string|WriterWriterInterface
  • int
  • array|null
Return type:

Logger

Throws :

ExceptionInvalidArgumentException

1128.1.1.7. getWriters

getWriters()

Get writers

Return type:SplPriorityQueue

1128.1.1.8. setWriters

setWriters()

Set the writers

Parameters:SplPriorityQueue
Return type:Logger
Throws :ExceptionInvalidArgumentException

1128.1.1.9. getProcessorPluginManager

getProcessorPluginManager()

Get processor plugin manager

Return type:ProcessorPluginManager

1128.1.1.10. setProcessorPluginManager

setProcessorPluginManager()

Set processor plugin manager

Parameters:string|ProcessorPluginManager
Return type:Logger
Throws :ExceptionInvalidArgumentException

1128.1.1.11. processorPlugin

processorPlugin()

Get processor instance

Parameters:
  • string
  • array|null
Return type:

ProcessorProcessorInterface

1128.1.1.12. addProcessor

addProcessor()

Add a processor to a logger

Parameters:
  • string|ProcessorProcessorInterface
  • int
  • array|null
Return type:

Logger

Throws :

ExceptionInvalidArgumentException

1128.1.1.13. getProcessors

getProcessors()

Get processors

Return type:SplPriorityQueue

1128.1.1.14. log

log()

Add a message as a log entry

Parameters:
  • int
  • mixed
  • array|Traversable
Return type:

Logger

Throws :

ExceptionInvalidArgumentException if message can’t be cast to string

Throws :

ExceptionInvalidArgumentException if extra can’t be iterated over

Throws :

ExceptionRuntimeException if no log writer specified

1128.1.1.15. emerg

emerg()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.16. alert

alert()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.17. crit

crit()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.18. err

err()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.19. warn

warn()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.20. notice

notice()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.21. info

info()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.22. debug

debug()

@param string $message

Parameters:array|Traversable
Return type:Logger

1128.1.1.23. registerErrorHandler

registerErrorHandler()

Register logging system as an error handler to log PHP errors

Parameters:
  • Logger
  • bool
Return type:

mixed Returns result of set_error_handler

Throws :

ExceptionInvalidArgumentException if logger is null

1128.1.1.24. unregisterErrorHandler

unregisterErrorHandler()

Unregister error handler

1128.1.1.25. registerExceptionHandler

registerExceptionHandler()

Register logging system as an exception handler to log PHP exceptions

Parameters:Logger
Return type:bool
Throws :ExceptionInvalidArgumentException if logger is null

1128.1.1.26. unregisterExceptionHandler

unregisterExceptionHandler()

Unregister exception handler

1128.1.2. Constants

1128.1.2.1. EMERG

@const int defined from the BSD Syslog message severities

1128.1.2.2. ALERT

1128.1.2.3. CRIT

1128.1.2.4. ERR

1128.1.2.5. WARN

1128.1.2.6. NOTICE

1128.1.2.7. INFO

1128.1.2.8. DEBUG