## Zend_Log

Description

- license: New BSD License
- copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Log.php (line 44)

Class Constant Summary
LEVEL_ALL = 255
LEVEL_DEBUG = 1
LEVEL_ERROR = 8
LEVEL_INFO = 2
LEVEL_SEVERE = 16
LEVEL_WARNING = 4
Variable Summary
static array $_levelNames
Zend_Log_Adapter_Interface $_adapter
array $_fields
integer $_levelMask
string $_logName
string $_messagePrefix
string $_messageSuffix
Method Summary
static boolean close ()
static array getFields ([string $logName = null])
static array getLoggerInfo ()
static boolean hasLogger ([string $logName = null])
static boolean isLogLevel (int $level)
static boolean log (string $message, [integer $level = self::LEVEL_DEBUG], [mixed $logName_or_fields = null], [string $logName = null])
static boolean registerLogger (Zend_Log_Adapter_Interface $logAdapter, [string $logName = null])
static void setAdapterOption (string $optionKey, string $optionValue, [string $logName = null])
static boolean setDefaultLogger ([string $logName = null])
static boolean setFields (array $fields, [string $logName = null])
static boolean setLevel (integer $level, [string $logName = null])
static boolean setMask (integer $mask, [string $logName = null])
static boolean setMessagePrefix (string $prefix, [string $logName = null])
static boolean setMessageSuffix (string $suffix, [string $logName = null])
static boolean unregisterLogger ([string $logName = null])
Variables
static array $_levelNames = array(
1 => 'DEBUG',
2 => 'INFO',
4 => 'WARNING',
8 => 'ERROR',
16 => 'SEVERE'
) (line 66)

This array contains the names of the log levels in order to support logging the names of the log message level instead of its numeric value.

- access: protected

Zend_Log_Adapter_Interface $_adapter = null (line 117)

Every instance of Zend_Log must contain a child object which is an implementation of Zend_Log_Adapter that provides the log storage.

- access: protected

array $_fields = array('message' => '',
'level' => '') (line 140)

Array of available fields for logging

- access: protected

integer $_levelMask = self::LEVEL_ALL (line 108)

Logging level mask, the bitwise OR of any of the Zend_Log::LEVEL_* constants that will be logged by this instance of Zend_Log. All other levels will be ignored.

- access: protected

string $_logName = '' (line 99)

When this class is instantiated by registerLogger, it is

pushed onto the $_instances associative array. The $_logName is the key to instance in this array, and also how the user will specify the instance when using the other static method calls (e.g. Zend_Log::log() ).

- access: protected

string $_messagePrefix = '' (line 125)

A string which is automatically prefixed to any message sent to the Zend_Log::log() method.

- access: protected

string $_messageSuffix = '' (line 133)

A string which is automatically appended to any message sent to the Zend_Log::log() method.

- access: protected

Methods
static close (line 442)

Destroy all Zend_Log instances in Zend_Log::$_instances. This is equivalent to calling unregister() for each log instance.

- return: True
- access: public

static boolean close ()
static getFields (line 331)

Returns an array of the log fields.

- access: public

static array getFields ([string $logName = null])

- string $logName

static getLoggerInfo (line 263)

Returns information about the registered loggers.

array(2) { ["LOG"]=> array key is the logger name array(2) { ["adapter"]=> string, name of the Zend_Log_AdapterClass class ["default"]=> boolean, is this the default logger? } }

- return: Is there at least one registered logger?
- access: public

static array getLoggerInfo ()
static hasLogger (line 240)

Returns True if the specified logName is a registered logger. If no logName is supplied, the function returns True if at least one logger exists.

- return: Registered logger?
- access: public

static boolean hasLogger ([string $logName = null])

- string $logName: Name of registered logger to check, or null.

static isLogLevel (line 543)

Tests if the supplied $level is one of the valid log levels (Zend_Log::LEVEL_* constants).

- return: Is it a valid level?
- access: public

static boolean isLogLevel (int $level)

- int $level: Value to test

static log (line 351)

Sends a message to the log.

- return: True
- access: public
- throws: Zend_Log_Exception

static boolean log (string $message, [integer $level = self::LEVEL_DEBUG], [mixed $logName_or_fields = null], [string $logName = null])

- string $message
- integer $level
- mixed $logName_or_fields
- string $logName

static registerLogger (line 194)

Instantiates a new instance of Zend_Log carrying the supplied Zend_Log_Adapter_Interface and stores it in the $_instances array.

- return: True
- access: public
- throws: Zend_Log_Exception

static boolean registerLogger (Zend_Log_Adapter_Interface $logAdapter, [string $logName = null])

- Zend_Log_Adapter_Interface $logAdapter: Log adapter implemented from Zend_Log_Adapter_Interface
- string $logName: Name of this instance, used to access it from other static functions.

static setAdapterOption (line 530)

Sets and adapter-specific option.

- access: public

static void setAdapterOption (string $optionKey, string $optionValue, [string $logName = null])

- string $optionKey: The option name
- string $optionValue: The option value
- string $logName: Name of this instance

static setDefaultLogger (line 286)

Sets the default logger. If no logName is specified, then "LOG" is used. For any named logger other than "LOG", the logger must have been registered with registerLogger().

- return: True
- access: public

static boolean setDefaultLogger ([string $logName = null])

- string $logName: Name of this instance, used to access it from other static functions.

static setFields (line 306)

Sets the values for log fields. Omitted fields are set to default values.

- return: True
- access: public

static boolean setFields (array $fields, [string $logName = null])

- array $fields
- string $logName

static setLevel (line 491)

Sets the logging level of the log instance to one of the Zend_Log::LEVEL_* constants. Only messages with this log level will be logged by the instance, all others will be ignored.

- return: True
- access: public
- throws: Zend_Log_Exception

static boolean setLevel (integer $level, [string $logName = null])

- integer $level
- string $logName: Name of this instance

static setMask (line 511)

Sets the logging level of the log instance based on a mask. The mask is the bitwise OR of any of the Zend_Log::LEVEL_* constants.

- return: True
- access: public
- throws: Zend_Log_Exception

static boolean setMask (integer $mask, [string $logName = null])

- integer $mask: The log level mask
- string $logName: Name of this instance

static setMessagePrefix (line 460)

Sets a message prefix. The prefix will be automatically prepended to any message that is sent to the specified log.

- return: True
- access: public

static boolean setMessagePrefix (string $prefix, [string $logName = null])

- string $prefix: The prefix string
- string $logName: Name of this instance

static setMessageSuffix (line 475)

Sets a message suffix. The suffix will be automatically appended to any message that is sent to the specified log.

- return: True
- access: public

static boolean setMessageSuffix (string $suffix, [string $logName = null])

- string $suffix: The suffix string
- string $logName: Name of this instance

static unregisterLogger (line 218)

Destroys an instance of Zend_Log in the $_instances array that was added by registerLogger()

- return: True
- access: public
- throws: Zend_Log_Exception

static boolean unregisterLogger ([string $logName = null])

- string $logName: Name of this instance, used to access it from other static functions.

Class Constants
LEVEL_ALL = 255 (line 49)

Mask that includes all log levels

LEVEL_DEBUG = 1 (line 54)

Log levels

LEVEL_ERROR = 8 (line 57)
LEVEL_INFO = 2 (line 55)
LEVEL_SEVERE = 16 (line 58)
LEVEL_WARNING = 4 (line 56)

Documentation generated on Wed, 21 Feb 2007 11:53:04 -0800 by phpDocumentor 1.3.1