This class represents a log writer.
Before you can use the logger you must call setupLogger (usually on your application object) to establish a connection.
- CREATE TABLE logs (
- id INT UNSIGNED NOT NULL AUTO_INCREMENT,
- time TIMESTAMP NOT NULL DEFAULT 'now()',
- level ENUM('notice', 'warning', 'error', 'debug') NOT NULL,
- caller VARCHAR(255) NOT NULL,
- context VARCHAR(255) NOT NULL,
- msg TEXT NOT NULL,
- rusage VARCHAR(32) NULL,
- PRIMARY KEY(id)
- );
- --
- $o = new IsterObject()
- $o->setLogger('IsterLoggerMysql');
- $o->setupLogger('IsterLoggerMysql',
- array('host' => '<localhost>',
- 'user' => '<testuser>',
- 'pass' => '<testpass>',
- 'db' => '<test>',
- 'table' => 'logs',
- 'loglevel' => E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE,
- 'rusage' => false));