ILIAS
Release_4_0_x_branch Revision 61816
|
$Header$ More...
$Header$
The Log:: class implements both an abstraction for various logging mechanisms and the Subject end of a Subject-Observer pattern.
The Log_win class is a concrete implementation of the Log abstract class that logs messages to a separate browser window.
The Log_syslog class is a concrete implementation of the Log:: abstract class which sends messages to syslog on UNIX-like machines (PHP emulates this with the Event Log on Windows machines).
The Log_sqlite class is a concrete implementation of the Log:: abstract class which sends messages to an Sqlite database.
We require the PEAR DB class.
The Log_observer:: class implements the Observer end of a Subject-Observer pattern for watching log activity and taking actions on exceptional events.
The Log_null class is a concrete implementation of the Log:: abstract class.
The Log_mdb2 class is a concrete implementation of the Log:: abstract class which sends messages to an SQL server.
The Log_mcal class is a concrete implementation of the Log:: abstract class which sends messages to a local or remote calendar store accessed through MCAL.
The Log_mail class is a concrete implementation of the Log:: abstract class which sends log messages to a mailbox.
The Log_firebug class is a concrete implementation of the Log:: abstract class which writes message into Firebug console.
The Log_file class is a concrete implementation of the Log abstract class that logs messages to a text file.
The Log_error_log class is a concrete implementation of the Log abstract class that logs messages using PHP's error_log() function.
The Log_display class is a concrete implementation of the Log:: abstract class which writes message into browser in usual PHP maner.
The Log_daemon class is a concrete implementation of the Log:: abstract class which sends messages to syslog daemon on UNIX-like machines.
The Log_console class is a concrete implementation of the Log:: abstract class which writes message to the text console.
The Log_composite:: class implements a Composite pattern which allows multiple Log implementations to receive the same events.
This class uses the syslog protocol: http://www.ietf.org/rfc/rfc3164.txt
This may be useful because when you use PEAR::setErrorHandling in PEAR_ERROR_CALLBACK mode error messages are not displayed by PHP error handler.
The mail is actually sent when you close() the logger, or when the destructor is called (when the script is terminated).
PLEASE NOTE that you must create a Log_mail object using =&, like this : $logger =& Log::factory("mail", "recipient@example.com", ...)
This is a PEAR requirement for destructors to work properly. See http://pear.php.net/manual/en/class.pear.php
Each entry occupies a separate row in the database.
This implementation uses PEAR's MDB2 database abstraction layer.
CREATE TABLE log_table ( id INT NOT NULL, logtime TIMESTAMP NOT NULL, ident CHAR(16) NOT NULL, priority INT NOT NULL, message VARCHAR(200), PRIMARY KEY (id) );
It simply consumes log events.
This is generally defined in the DB.php file, but it's possible that the caller may have provided the DB class, or a compatible wrapper (such as the one shipped with MDB2), so we first check for an existing 'DB' class before including 'DB.php'. The Log_sql class is a concrete implementation of the Log:: abstract class which sends messages to an SQL server. Each entry occupies a separate row in the database.
This implementation uses PHP's PEAR database abstraction layer.
CREATE TABLE log_table ( id INT NOT NULL, logtime TIMESTAMP NOT NULL, ident CHAR(16) NOT NULL, priority INT NOT NULL, message VARCHAR(200), PRIMARY KEY (id) );
Each entry occupies a separate row in the database.
This implementation uses PHP native Sqlite functions.
CREATE TABLE log_table ( id INTEGER PRIMARY KEY NOT NULL, logtime NOT NULL, ident CHAR(16) NOT NULL, priority INT NOT NULL, message );
The concept for this log handler is based on part by Craig Davis' article entitled "JavaScript Power PHP Debugging:
http://www.zend.com/zend/tut/tutorial-DebugLib.php