Log

Log -- Logging abstraction class

Synopsis

require_once "Log.php";

Description

Logging interface functions.

Log::factory

object Log::factory (string log_type [, string log_name [, string ident [, array conf]]])

Return a concrete Log instance of log_type.

Log::singleton

object Log::singleton (string log_type [, string log_name [, string ident [, array conf]]])

Returns a reference to a concrete Log instance of log_type, only creating a new instance if no Log instance with the same parameters currently exists.

You should use this if there are multiple places you might create a logger, you don't want to create multiple loggers, and you don't want to check for the existance of one each time. The singleton pattern does all the checking work for you.

Anmerkung: You MUST call this method with the $var = &Log::singleton() syntax. Without the ampersand (&) in front of the method name, you will not get a reference; you will get a copy.

Log::attach

Log::attach (object logObserver)

Adds a Log_Observer instance to the list of observers that are to be notified when a message is logged.

Log::detach

Log::detach (object logObserver)

Removes a Log_Observer instance from the list of observers.

Log::notifyAll

Log::notifyAll (array messageOb)

Sends any Log_Observer objects listening to this Log the message that was just logged.