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. You must not change the names of the columns but may setaup a name for the table.
- CREATE TABLE logs (
- id INT NOT NULL,
- time TIMESTAMP NOT NULL,
- level VARCHAR(32) 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('module' => <integer> // one of the DBX_* module constants
- 'host' => <string>,
- 'user' => <string>,
- 'pass' => <string>,
- 'db' => <string>,
- 'table' => 'logs', // optional
- 'loglevel' => E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE,
- 'rusage' => false, // optional
- 'autoid' => false // optional
- ));