PHP Class Horde_Log_Logger, horde

Author: Mike Naberezny ([email protected])
Author: Chuck Hagenbuch ([email protected])
Inheritance: implements Serializable
Show file Open project: horde/horde Class Usage Examples

Public Methods

Method Description
__call ( string $method, string $params ) Undefined method handler allows a shortcut:
$log->levelName('message');
  instead of
$log->log('message', Horde_Log_LEVELNAME);
__construct ( Horde_Log_Handler_Base | null $handler = null ) Constructor.
addFilter ( Horde_Log_Filter $filter ) Add a filter that will be applied before all log handlers.
addHandler ( Horde_Log_Handler_Base $handler ) Add a handler. A handler is responsible for taking a log message and writing it out to storage.
addLevel ( string $name, integer $level ) Add a custom log level
hasLevel ( string $name ) : boolean Does this logger have the level $name already?
log ( mixed $event, integer $level = null ) Log a message at a level
serialize ( ) : string Serialize.
unserialize ( string $data ) Unserialize.

Protected Methods

Method Description
_init ( ) Initialization tasks.

Method Details

__call() public method

Undefined method handler allows a shortcut:
$log->levelName('message');
  instead of
$log->log('message', Horde_Log_LEVELNAME);
public __call ( string $method, string $params )
$method string Log level name.
$params string Message to log.

__construct() public method

Constructor.
public __construct ( Horde_Log_Handler_Base | null $handler = null )
$handler Horde_Log_Handler_Base | null Default handler.

_init() protected method

Initialization tasks.
protected _init ( )

addFilter() public method

Before a message will be received by any of the handlers, it must be accepted by all filters added with this method.
public addFilter ( Horde_Log_Filter $filter )
$filter Horde_Log_Filter Filter to add.

addHandler() public method

Add a handler. A handler is responsible for taking a log message and writing it out to storage.
public addHandler ( Horde_Log_Handler_Base $handler )
$handler Horde_Log_Handler_Base Handler to add.

addLevel() public method

Add a custom log level
public addLevel ( string $name, integer $level )
$name string Name of level.
$level integer Numeric level.

hasLevel() public method

Does this logger have the level $name already?
public hasLevel ( string $name ) : boolean
$name string The level name to check for.
return boolean Whether the logger already has the specific level name.

log() public method

Log a message at a level
public log ( mixed $event, integer $level = null )
$event mixed Message to log, either an array or a string.
$level integer Log level of message, required if $message is a string.

serialize() public method

Serialize.
public serialize ( ) : string
return string Serialized representation of this object.

unserialize() public method

Unserialize.
public unserialize ( string $data )
$data string Serialized data.