Zend Framework
1.12
|
Public Member Functions | |
__construct (Zend_Log_Writer_Abstract $writer=null) | |
Class constructor. | |
__destruct () | |
Class destructor. | |
__call ($method, $params) | |
Undefined method handler allows a shortcut: $log->priorityName('message') instead of $log->log('message', Zend_Log::PRIORITY_NAME) | |
log ($message, $priority, $extras=null) | |
Log a message at a priority. | |
addPriority ($name, $priority) | |
Add a custom priority. | |
addFilter ($filter) | |
Add a filter that will be applied before all log writers. | |
addWriter ($writer) | |
Add a writer. | |
setEventItem ($name, $value) | |
Set an extra item to pass to the log writers. | |
registerErrorHandler () | |
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. | |
errorHandler ($errno, $errstr, $errfile, $errline, $errcontext) | |
Error Handler will convert error into log message, and then call the original error handler. | |
setTimestampFormat ($format) | |
Set timestamp format for log entries. | |
getTimestampFormat () | |
Get timestamp format used for log entries. | |
Static Public Member Functions | |
static | factory ($config=array()) |
Factory to construct the logger and one or more writers based on the configuration array. | |
Public Attributes | |
const | EMERG = 0 |
const | ALERT = 1 |
const | CRIT = 2 |
const | ERR = 3 |
const | WARN = 4 |
const | NOTICE = 5 |
const | INFO = 6 |
const | DEBUG = 7 |
Protected Member Functions | |
_constructWriterFromConfig ($config) | |
Construct a writer object based on a configuration array. | |
_constructFilterFromConfig ($config) | |
Construct filter object from configuration array or Zend_Config object. | |
_constructFormatterFromConfig ($config) | |
Construct formatter object from configuration array or Zend_Config object. | |
_constructFromConfig ($type, $config, $namespace) | |
Construct a filter or writer from config. | |
getClassName ($config, $type, $defaultNamespace) | |
Get the writer or filter full classname. | |
_packEvent ($message, $priority) | |
Packs message and priority into Event array. | |
Protected Attributes | |
$_priorities = array() | |
$_writers = array() | |
$_filters = array() | |
$_extras = array() | |
$_defaultWriterNamespace = 'Zend_Log_Writer' | |
$_defaultFilterNamespace = 'Zend_Log_Filter' | |
$_defaultFormatterNamespace = 'Zend_Log_Formatter' | |
$_origErrorHandler = null | |
$_registeredErrorHandler = false | |
$_errorHandlerMap = false | |
$_timestampFormat = 'c' | |
__construct | ( | Zend_Log_Writer_Abstract | $writer = null | ) |
Class constructor.
Create a new logger
Zend_Log_Writer_Abstract | null | $writer | default writer |
__destruct | ( | ) |
Class destructor.
Shutdown log writers
__call | ( | $method, | |
$params | |||
) |
Undefined method handler allows a shortcut: $log->priorityName('message') instead of $log->log('message', Zend_Log::PRIORITY_NAME)
string | $method | priority name |
string | $params | message to log |
Zend_Log_Exception |
|
protected |
Construct filter object from configuration array or Zend_Config object.
array | Zend_Config | $config | Zend_Config or Array |
Zend_Log_Exception |
|
protected |
Construct formatter object from configuration array or Zend_Config object.
array | Zend_Config | $config | Zend_Config or Array |
Zend_Log_Exception |
|
protected |
Construct a filter or writer from config.
string | $type | 'writer' of 'filter' |
mixed | $config | Zend_Config or Array |
string | $namespace |
Zend_Log_Exception |
|
protected |
Construct a writer object based on a configuration array.
array | $spec | config array with writer spec |
Zend_Log_Exception |
|
protected |
Packs message and priority into Event array.
string | $message | Message to log |
integer | $priority | Priority of message |
addFilter | ( | $filter | ) |
Add a filter that will be applied before all log writers.
Before a message will be received by any of the writers, it must be accepted by all filters added with this method.
int | Zend_Config | array | Zend_Log_Filter_Interface | $filter |
Zend_Log_Exception |
addPriority | ( | $name, | |
$priority | |||
) |
Add a custom priority.
string | $name | Name of priority |
integer | $priority | Numeric priority |
Zend_Log_Exception |
addWriter | ( | $writer | ) |
Add a writer.
A writer is responsible for taking a log message and writing it out to storage.
mixed | $writer | Zend_Log_Writer_Abstract or Config array |
errorHandler | ( | $errno, | |
$errstr, | |||
$errfile, | |||
$errline, | |||
$errcontext | |||
) |
Error Handler will convert error into log message, and then call the original error handler.
|
static |
Factory to construct the logger and one or more writers based on the configuration array.
array|Zend_Config | Array or instance of Zend_Config |
Zend_Log_Exception |
|
protected |
Get the writer or filter full classname.
array | $config | |
string | $type | filter|writer |
string | $defaultNamespace |
Zend_Log_Exception |
getTimestampFormat | ( | ) |
Get timestamp format used for log entries.
log | ( | $message, | |
$priority, | |||
$extras = null |
|||
) |
Log a message at a priority.
string | $message | Message to log |
integer | $priority | Priority of message |
mixed | $extras | Extra information to log in event |
Zend_Log_Exception |
registerErrorHandler | ( | ) |
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.
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
setEventItem | ( | $name, | |
$value | |||
) |
Set an extra item to pass to the log writers.
string | $name | Name of the field |
string | $value | Value of the field |
setTimestampFormat | ( | $format | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const ALERT = 1 |
const CRIT = 2 |
const DEBUG = 7 |
const EMERG = 0 |
const ERR = 3 |
const INFO = 6 |
const NOTICE = 5 |
const WARN = 4 |