Class Zend_Log

Description

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


	
			
Class Constant Summary
Variable Summary
Method Summary
 void close ()
 void getFields ([mixed $logName = null])
 array getLoggerInfo ()
 bool hasLogger ([string $logName = null])
 bool isLogLevel (int $level)
 Zend_Log __construct (string $logName, Zend_Log_Adapter_Interface $adapter)
 boolean log (string $message, [integer $level = self::LEVEL_DEBUG], [mixed $logName_or_fields = null], [string $logName = null])
 bool registerLogger (Zend_Log_Adapter_Interface $logAdapter, [string $logName = null])
 void setAdapterOption (mixed $optionKey, mixed $optionValue, [string $logName = null])
 bool setDefaultLogger ([string $logName = null])
 void setFields (mixed $fields, [mixed $logName = null])
 void setLevel (mixed $level, [string $logName = null])
 void setMask (mixed $mask, [string $logName = null])
 void setMessagePrefix (mixed $prefix, [string $logName = null])
 void setMessageSuffix (mixed $suffix, [string $logName = null])
 void unregisterLogger ([string $logName = null])
 void _getInstance ([logName $logName = null])
Variables
Zend_Log_Adapter_Interface $_adapter = null (line 94)

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 $_defaultLogName = 'LOG' (line 65)

The static class Zend_Log holds an array of Zend_Log instances in this variable that are created with registerLogger().

  • access: private
  • static:
mixed $_fields = array('message' => '',
'level' => '')
(line 114)
  • access: protected
array $_instances = array() (line 57)

The static class Zend_Log holds an array of Zend_Log instances in this variable that are created with registerLogger().

  • access: private
  • static:
integer $_levelMask = self::LEVEL_ALL (line 85)

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 76)

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 102)

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

  • access: protected
string $_messageSuffix = '' (line 110)

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

  • access: protected
Methods
close (line 397)

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

  • static:
  • access: public
void close ()
getFields (line 288)
  • static:
  • access: public
void getFields ([mixed $logName = null])
getLoggerInfo (line 233)

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"]=> bool, is this the default logger? } }

  • return: Is there at least one registered logger?
  • static:
  • access: public
array getLoggerInfo ()
hasLogger (line 210)

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?
  • static:
  • access: public
bool hasLogger ([string $logName = null])
  • string $logName: Name of registered logger to check, or null.
isLogLevel (line 486)

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

  • return: Is it a valid level?
  • static:
  • access: public
bool isLogLevel (int $level)
  • int $level: Value to test
Constructor __construct (line 130)

Class constructor. Zend_Log uses the singleton pattern. Only a single Zend_Log static class may be used, however instances of Zend_Log may be stored inside the Zend_Log static class by calling registerLogger().

  • access: private
Zend_Log __construct (string $logName, Zend_Log_Adapter_Interface $adapter)
  • string $logName: Name of the Zend_Log instance, which will be the key to the Zend_Log::$_instances array.
  • Zend_Log_Adapter_Interface $adapter
log (line 307)

Sends a message to the log.

  • static:
  • access: public
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
registerLogger (line 166)

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

  • return: True
  • static:
  • access: public
bool 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.
setAdapterOption (line 473)

Sets and adapter-specific option.

  • static:
  • access: public
void setAdapterOption (mixed $optionKey, mixed $optionValue, [string $logName = null])
  • string $logName: Name of this instance
setDefaultLogger (line 256)

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
  • static:
  • access: public
bool setDefaultLogger ([string $logName = null])
  • string $logName: Name of this instance, used to access it from other static functions.
setFields (line 269)
  • static:
  • access: public
void setFields (mixed $fields, [mixed $logName = null])
setLevel (line 439)

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.

  • static:
  • access: public
void setLevel (mixed $level, [string $logName = null])
  • string $logName: Name of this instance
setMask (line 456)

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.

  • static:
  • access: public
void setMask (mixed $mask, [string $logName = null])
  • string $logName: Name of this instance
setMessagePrefix (line 413)

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

  • static:
  • access: public
void setMessagePrefix (mixed $prefix, [string $logName = null])
  • string $logName: Name of this instance
setMessageSuffix (line 426)

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

  • static:
  • access: public
void setMessageSuffix (mixed $suffix, [string $logName = null])
  • string $logName: Name of this instance
unregisterLogger (line 188)

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

  • static:
  • access: public
void unregisterLogger ([string $logName = null])
  • string $logName: Name of this instance, used to access it from other static functions.
_getInstance (line 144)

Returns the instance of Zend_Log in the Zend_Log::$_instances array.

  • static:
  • access: private
void _getInstance ([logName $logName = null])
  • logName $logName: Key in the Zend_Log::$_instances associate array.
Class Constants
LEVEL_ALL = 255 (line 44)
LEVEL_DEBUG = 1 (line 49)
LEVEL_ERROR = 8 (line 46)
LEVEL_INFO = 2 (line 48)
LEVEL_SEVERE = 16 (line 45)
LEVEL_WARNING = 4 (line 47)

Documentation generated on Tue, 18 Apr 2006 11:55:17 -0700 by phpDocumentor 1.3.0RC3