TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
log Class Reference

Titan Log Handler Class. More...

Public Member Functions

 __construct ($pid= '', $table= '')
 
 __get ($name)
 
 __set ($name, $value)
 
 write ($message, $pid= '', $username= '')
 

Protected Attributes

 $db
 Database object.
 
 $table = 'system_log'
 The name of the log table.
 
 $pid = ''
 Process ID.
 
 $msg = ''
 Last recorded message, if any.
 

Detailed Description

Titan Log Handler Class.

Class: \tl\debug\log Requires: \tl\core\di, \tl\data\timestamp, \tl\io\pdo\mysql

Author
James E. Bush work@.nosp@m.bush.nosp@m..cc
Version
5.1.0

Table system_log:

  DROP TABLE IF EXISTS `system_log`;
  CREATE TABLE IF NOT EXISTS `system_log` (
    `idx` int(11) NOT NULL AUTO_INCREMENT,
    `timestamp` varchar(14) COLLATE utf8_unicode_ci NOT NULL,
    `pid` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
    `username` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
    `message` text COLLATE utf8_unicode_ci NOT NULL,
    PRIMARY KEY (`idx`),
    KEY `timestamp` (`timestamp`),
    KEY `pid` (`pid`),
    KEY `username` (`username`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

Constructor & Destructor Documentation

__construct (   $pid = '',
  $table = '' 
)

Constructor

Parameters
string$pidProcess ID
string$table(optional) Log table name (default) '' = use preset 'system_log'

Member Function Documentation

__get (   $name)

Get the value of a property

Parameters
string$nameProperty name to get
__set (   $name,
  $value 
)

Set the value of a property

Parameters
string$nameProperty name to set
string$valueValue to set
write (   $message,
  $pid = '',
  $username = '' 
)

Wite a message to the log table

Parameters
string$messageThe message you want to log
string$pid(optional) Process ID (default) '' = use value set with constructor, if available
string$username(optional) username (default) '' = use $auth->acct->username, if available

The documentation for this class was generated from the following file: