category |
Zend |
package |
Zend_Log |
copyright |
Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license |
New BSD License |
version |
$Id$
Convenience methods for log [@see Zend_Log::__call()]: |
Methods
Undefined method handler allows a shortcut:
$log->priorityName('message')
instead of
$log->log('message', Zend_Log::PRIORITY_NAME)
__call(string $method, string $params) : void
Parameters
$method
string
priority name
$params
string
message to log
Exceptions
Class constructor. Create a new logger
__construct(\Zend_Log_Writer_Abstract|null $writer = null
)
Parameters
$writer
\Zend_Log_Writer_Abstract
null
default writer
Class destructor. Shutdown log writers
__destruct() : void
Add a filter that will be applied before all log writers.
addFilter(integer|\Zend_Config|array|\Zend_Log_Filter_Interface $filter) : \Zend_Log
Before a message will be received by any of the writers, it
must be accepted by all filters added with this method.
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$filter
integer
\Zend_Config
array
\Zend_Log_Filter_Interface
Exceptions
Returns
\Zend_Log
Add a custom priority
addPriority(string $name, integer $priority) : \Zend_Log
fluent |
This method is part of a fluent interface and will return the same instance |
Parameters
$name
string
Name of priority
$priority
integer
Numeric priority
Exceptions
Returns
\Zend_Log
Add a writer. A writer is responsible for taking a log
message and writing it out to storage.
addWriter(mixed $writer) : \Zend_Log
Parameters
$writer
mixed
Zend_Log_Writer_Abstract or Config array
Exceptions
Returns
\Zend_Log
Error Handler will convert error into log message, and then call the original error handler
errorHandler(integer $errno, string $errstr, string $errfile, integer $errline, array $errcontext) : boolean
Parameters
$errno
integer
$errstr
string
$errfile
string
$errline
integer
$errcontext
array
Returns
boolean
Factory to construct the logger and one or more writers
based on the configuration array
factory($config = array()
) : \Zend_Log
Static
Parameters
$config
Exceptions
Returns
\Zend_Log
Log a message at a priority
log(string $message, integer $priority, mixed $extras = null
) : void
Parameters
$message
string
Message to log
$priority
integer
Priority of message
$extras
mixed
Extra information to log in event
Exceptions
Register Logging system as an error handler to log php errors
Note: it still calls the original error handler if set_error_handler is able to return it.
registerErrorHandler() : \Zend_Log
Errors will be mapped as:
E_NOTICE, E_USER_NOTICE => NOTICE
E_WARNING, E_CORE_WARNING, E_USER_WARNING => WARN
E_ERROR, E_USER_ERROR, E_CORE_ERROR, E_RECOVERABLE_ERROR => ERR
E_DEPRECATED, E_STRICT, E_USER_DEPRECATED => DEBUG
(unknown/other) => INFO
Returns
\Zend_Log
Set an extra item to pass to the log writers.
setEventItem(string $name, string $value) : \Zend_Log
Parameters
$name
string
Name of the field
$value
string
Value of the field
Returns
\Zend_Log
Construct filter object from configuration array or Zend_Config object
_constructFilterFromConfig(array|\Zend_Config $config) : \Zend_Log_Filter_Interface
Parameters
$config
array
\Zend_Config
Zend_Config or Array
Exceptions
Returns
\Zend_Log_Filter_Interface
Construct a filter or writer from config
_constructFromConfig(string $type, mixed $config, string $namespace) : object
Parameters
$type
string
'writer' of 'filter'
$config
mixed
Zend_Config or Array
$namespace
string
Exceptions
Returns
object
Construct a writer object based on a configuration array
_constructWriterFromConfig(array $config) : \Zend_Log_Writer_Abstract
Parameters
$config
array
config array with writer spec
Exceptions
Returns
\Zend_Log_Writer_Abstract
Packs message and priority into Event array
_packEvent(string $message, integer $priority) : array
Parameters
$message
string
Message to log
$priority
integer
Priority of message
Returns
array
Event array
Get the writer or filter full classname
getClassName(array $config, string $type, string $defaultNamespace) : string
Parameters
$config
array
$type
string
filter|writer
$defaultNamespace
string
Exceptions
Returns
string
full classname
Properties
$_defaultFilterNamespace
$_defaultFilterNamespace : string
Default
'Zend_Log_Filter'
$_defaultWriterNamespace
$_defaultWriterNamespace : string
Default
'Zend_Log_Writer'
$_errorHandlerMap
$_errorHandlerMap : array | boolean
of Zend_Log_Filter_Interface
$_filters : array
$_origErrorHandler
$_origErrorHandler : callback
of priorities where the keys are the
priority numbers and the values are the priority names
$_priorities : array
$_registeredErrorHandler
$_registeredErrorHandler : boolean
of Zend_Log_Writer_Abstract
$_writers : array
Constants