util 
[ doc home ] [ class tree: util ] [ index: util ] [ all elements ]

Class: IsterLoggerDbx

Source Location: /IsterLoggerDbx.php

Class Overview

IsterLogger
   |
   --IsterLoggerDbx

This class represents a log writer.


Author(s): Ingo Schramm   

Copyright: Copyright (c) 2005 Ister.ORG Ingo Schramm

Methods


Inherited Constants

Inherited Variables

Inherited Methods

Class: IsterLogger

IsterLogger::IsterLogger()
Constructor
IsterLogger::getLevelStr()
Return a string representation of the log level.
IsterLogger::log()
Print the log message.
IsterLogger::setup()
Setup the logger.

Class Details

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.

  1. CREATE TABLE logs (
  2. id INT NOT NULL,
  3. time TIMESTAMP NOT NULL,
  4. level VARCHAR(32) NOT NULL,
  5. caller VARCHAR(255) NOT NULL,
  6. context VARCHAR(255) NOT NULL,
  7. msg TEXT NOT NULL,
  8. rusage VARCHAR(32) NULL,
  9. PRIMARY KEY(id)
  10. );
  11. --
  12. $o = new IsterObject()
  13. $o->setLogger('IsterLoggerMysql');
  14. $o->setupLogger('IsterLoggerMysql',
  15. array('module' => <integer> // one of the DBX_* module constants
  16. 'host' => <string>,
  17. 'user' => <string>,
  18. 'pass' => <string>,
  19. 'db' => <string>,
  20. 'table' => 'logs', // optional
  21. 'loglevel' => E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE,
  22. 'rusage' => false, // optional
  23. 'autoid' => false // optional
  24. ));


copyright:  Copyright (c) 2005 Ister.ORG Ingo Schramm
author:  Ingo Schramm


[ Top ]


Class Methods


method IsterLoggerMysql

void IsterLoggerMysql( )

Constructor

[ Top ]

method log

integer log( mixed $msg, mixed $level, mixed $caller, [mixed $context = null])

Write a log entry.

If no connection is active, log() will return silently. The logging table must already exist.


Overrides IsterLogger::log() (Print the log message.)

[ Top ]

method setup

void setup( array $array)

Setup the logger.

Overrides IsterLogger::setup() (Setup the logger.)

Parameters:

array   $array   An array cntaining setup data.

[ Top ]


Documentation generated on Tue, 20 Dec 2005 11:20:54 +0100 by phpDocumentor 1.3.0RC4