This class represents a log writer.
You cannot use ister.sql package objects to process database queries with this logger since the objects of the package do loggging themselves via the loggar facility and this would lead to sever recursion. The logging table must already exist.
- CREATE TABLE logs (
- id SERIAL PRIMARY KEY,
- time TIMESTAMP NOT NULL DEFAULT now(),
- level VARCHAR(16) NOT NULL,
- caller VARCHAR(255) NOT NULL,
- context VARCHAR(255) NOT NULL,
- msg TEXT NOT NULL,
- rusage VARCHAR(32) NULL
- );
- --
- $o = new IsterObject()
- $o->setLogger('IsterLoggerPostgresql');
- $o->setupLogger('IsterLoggerPostgresql',
- array('host' => '<localhost>',
- 'user' => '<testuser>',
- 'pass' => '<testpass>',
- 'db' => '<test>',
- 'table' => 'logs',
- 'loglevel' => E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE,
- 'rusage' => false));